I=input N=int(I()) A=list(map(int,I().split())) print(["No","Yes"][all((A[0]-a)%N<1for a in A)])