from collections import defaultdict

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

dic = defaultdict(int)

for a in A:
    dic[a] += 1

n = len(dic.keys())
cnts = dic.values()

if n == 3:
    v = list(dic.keys())
    f1 = False
    for i in range(n):
        for j in range(i+1, n):
            for k in range(j+1, n):
                if v[i] ^ v[j] == v[k]:
                    f1 = True

    f2 = True
    for cnt in cnts:
        if cnt != N // 3:
            f2 = False

    if f1 and f2:
        print('Yes')
    else:
        print('No')
    
else:
    print('No')