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

ans = "No"

if a == [0]:
    ans = "Yes"
elif len(a) == 3:
    if a[0] ^ a[1] == a[2] and N % 3 == 0 and A.count(A[0]) == A.count(A[1]) == N//3:
        ans = "Yes"
elif len(a) == 2:
    if a[0] == 0 or a[1] == 0 and N % 3 == 0 and A.count(0) == N//3:
        ans = "Yes"

print(ans)