from collections import Counter

n = int(input())
a = Counter(map(int, input().split()))

cnt = 0
for i in a:
    cnt ^= i

if cnt == n % 3 == 0 and all(a[i] % (n // 3) == 0 for i in a):
    print('Yes')
elif cnt == 0 and a[0] == n:
    print('Yes')
else:
    print('No')
