n=int(input()) A=list(map(int,input().split())) for i in range(n-1): if abs(A[i]-A[i+1])%(n)!=0: print("No") exit() print("Yes")