Measurement of anisotropies in cosmic ray arrival directions with the Alpha Magnetic Spectrometer on the ISS