n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
flag = True
if(a[n-1]^a[1] != a[0]):
    flag = False
if(a[n-2]^a[0] != a[n-1]):
    flag = False

for i in range(1, n-1):
    if (a[i-1] ^ a[i+1] != a[i]):
        flag = False

if(flag):
    print("Yes")
else:
    print("No")