N = int(input()) A = [int(x) for x in input().split()] ok = True for i in range(N) : ok = ok and (A[i] + A[-1-i] == A[0] + A[-1]) print("Yes" if ok else "No")