S&P 500 ends up with Apple, Pfizer; Nasdaq dips