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