import sys
N = int(input())
a_lis = [int(_) for _ in input().split()]

def func(x, y):
    return x ^ y

def finish(ans, a_lis_item):
    if ans != a_lis_item:
        print('No')
        sys.exit()

for i, a in enumerate(a_lis):
    if i == 0:
        ans = func(a_lis[N - 1], a_lis[1])
    elif i == N - 1:
        ans = func(a_lis[0], a_lis[N - 2])
    else:
        ans = func(a_lis[i - 1], a_lis[i + 1])
    finish(ans, a_lis[i])

print('Yes')