import sys

N = int(input())
a = list(map(int, input().split()))

from collections import Counter
ac = Counter(a)

if len(ac) == 3 and len(Counter(ac.values())) == 1:
    print('Yes')
    sys.exit()
if len(ac) == 2 and ac.most_common()[0][1] == ac.most_common()[1][1] * 2 and ac.most_common()[0][0]^ac.most_common()[0][0] == ac.most_common()[1][0]:
    print('Yes')
    sys.exit()
if len(ac) == 1 and ac.most_common()[0][0] == 0:
    print('Yes')
    sys.exit()
print('No')