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

ans = list(set(A))
if len(ans) > 3:
    print('No')
    exit()

a0 = ans[0]
a1 = ans[1]
a2 = ans[2]

if a0 ^ a1 == a2:
    print('Yes')
else:
    print('No')
