S&P 500 notches third record close this week