Arsenal rose to second in the Premier League table with an absorbing 5-2 win over London rivals West Ham United at the London Stadium, a derby in which all seven goals were scored in the first half.