# 2019. 7/14
# AGC 035 A

N = int(input())
caps = list(map(int, input().split()))

is_ok = True

for i in range(N - 2):
    a = caps[i]
    b = caps[i + 1]
    c = caps[i + 2]

    if b != (a ^ c):
        is_ok = False
        break

a = caps[0]
b = caps[1]
c = caps[-1]

if a != (b ^ c):
    is_ok = False

a = caps[-2]
b = caps[-1]
c = caps[0]

if b != (a ^ c):
    is_ok = False

if is_ok:
    print('Yes')
else:
    print('No')