n = int(input())
a = map(int, input().split())
from collections import Counter
ls = Counter(a)
key = list(ls.keys())
val = list(ls.values())
if len(key) == 3 and n % 3 == 0:
    if key[0] ^ key[1] == key[2] or key[1] ^ key[2] == key[0] or key[2] ^ key[0] == key[1]:
        print('Yes')
    else:
        print('No')
elif key[0] == 0 and val[0] == n:
    print('Yes')
else:
    print('No')