N = int(input()) A = [int(s) for s in input().split()] if len(set(A[i] + A[~i] for i in range(N))) == 1: print("Yes") else: print("No")