from collections import defaultdict

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

a = A[0]
c = A[1]
b = a ^ c

f = True

for i in range(3, N):
    if i % 3 == 0 and a != A[i]:
        f = False
    elif i % 3 == 1 and b != A[i]:
        f = False
    elif i % 3 == 2 and c != A[i]:
        f = False

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