N = int(input()) a = list(map(int,input().split())) b = [] for i in range(N - 1): b.append(a[i + 1] - a[i]) s = sum(b) flag = True for i in b: if b % N != 0: flag = False if s == 0 and flag: print('Yes') else: print('No')