n=int(input()) a=list(map(int,input().split())) print(["No","Yes"][len(set(a[i]+a[~i] for i in range(n)))==1])