import math

n = list(map(int, input().split()))
n = n[0]
b = list(map(int, input().split()))

b.sort()

if (n%3==0):
    flag = 1
    for i in range(3):
        for j in range(n//3-1):
            if(b[(n//3)*i + j] != b[(n//3)*i + j+1]):
                flag *= 0
            if(b[(n//3)*2]^b[n//3]!=b[0]):
                flag *= 0
    if(flag==1):
        ans="Yes"
    else:
        ans="No"
else:
    ans="No"
print(ans)