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

k = {}
for i in range(N):
    if i == 0:
        B = A[0]
    else:
        B = B ^ A[i]
    if not A[i] in k:
        k[A[i]] = 1
    else:
        k[A[i]] += 1

a = 0
for key, val in k.items():
    if val == N // 3:
        a += 1
    elif val == N // 3 * 2:
        a += 2

if N % 3 == 0 and  B == 0 and a == 3:
    ans = 'Yes'
else:
    ans = 'No'

print(ans)