Wall Street ends higher, breaking a three-day losing streak