Nasdaq, S&P 500 edge higher on Amazon boost; Dow under pressure