from collections import defaultdict
n = int(input())
aa = list(map(int, input().split()))

if n % 3 != 0:
    if all(map(lambda x: x == 0, aa)):
        print('Yes')
    else:
        print('No')
    exit(0)
m = n // 3

cnt_map = defaultdict(int)
for a in aa:
    cnt_map[a] += 1

if len(cnt_map.keys()) > 3:
    print('No')
elif len(cnt_map.keys()) == 1:
    k = cnt_map.keys()[0]
    if k == 0:
        print('Yes')
    else:
        print('No')
elif len(cnt_map.keys()) == 2:
    k1, k2 = cnt_map.keys()
    if k1 > k2:
        k1, k2 = k2, k1
    if k1 == 0 and cnt_map[k1] == m:
        print('Yes')
    else:
        print('No')
elif len(cnt_map.keys()) == 3:
    a, b, c = cnt_map.keys()
    if a == b ^ c and cnt_map[a] == m and cnt_map[b] == m and cnt_map[c] == m:
        print('Yes')
    else:
        print('No')
