n = int(input()) A = list(map(int, input().split())) B = [A[i]+A[-1-i] for i in range(n)] print("Yes" if min(B) == max(B) else "No")