input() A = list(map(int, input().split())) s = [a + b for a, b in zip(A, A[::-1])] print("Yes" if len(set(s)) == 1 else "No")