n = int(input())
A = list(map(int,input().split()))
B = list(set(A))
if len(B) == 2:
    B.sort()
    B.append(B[1])
if (len(B) == 3 and B[0]^B[1] == B[2] and n%3 == 0):
    print("Yes")
else:
    print("No")
