import itertools
import numpy as np
import collections

N = int(input())
A = [int(_) for _ in input().split()]
count = collections.defaultdict(int)
for x in A:
    count[x] += 1
if len(count) == 1:
    a = list(count.keys())[0]
    #if a == 0:
    # print('Yes')
    #exit()
    print('Yes')
    exit()
elif len(count) == 2:
    a, b = sorted(count.keys())
    if a == 0 and count[a] == 1 and count[b] == 2:
        print('Yes')
        exit()
elif len(count) == 3:
    a, b, c = count.keys()
    if a ^ b == c and count[a] == count[b] == count[c]:
        print('Yes')
        exit()
print('No')
