N = int(input()) A = list(map(int, input().split())) S = set() for i in range(N): S.add(A[i]+A[N-1-i]) print("Yes" if len(S) == 1 else "No")