import collections
import itertools

n = int(input())
ls = list(map(int, input().split()))
counter = collections.Counter()
for x in ls:
    counter[x] += 1
if len(counter.keys()) > 3:
    print('No')
else:
    for a, b, c in itertools.combinations(counter.keys(), 3):
        if not (a ^ b == c and a ^ c == b and b ^ c == a):
            print('No')
            break
    else:
        print('Yes')