N=int(input()) A=[*map(int,input().split())] ss=set() for i in range(N//2+1): ss.add(A[i]+A[N-i-1]) if len(ss)==1: print('Yes') else: print('No' )