US stocks close at record highs for second consecutive day