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