from collections import Counter
N = int(input())
A = Counter(map(int, input().split()))
tmp = list(A.keys())
tmp.sort()
if len(tmp) == 1 and tmp[0] == 0 or len(tmp) == 2 and tmp[0] == 0 and list(A.values())[0] == N // 3 * 2 and list(A.values())[1] == N // 3 or len(tmp) == 3 and (tmp[0] ^ tmp[1] ^ tmp[2]) == 0 and list(A.values())[0] == list(A.values())[1] == list(A.values())[2] == N // 3:
    print('Yes')
else:
    print('No')


