n=int(input()) a=list(map(int,input().split())) print("Yes" if len({a[i]+a[n-i-1] for i in range(n)})==1 else "No")