a = input()
b = input().split()
b = [int(i) for i in b]
b = sorted(b)

is_done = False
for i in range(1, len(b)-1):
    if b[i] == b[i - 1] ^ b[i + 1]:
        pass
    else:
        print("No")
        is_done = True
        break
if is_done == False:
    if b[0] == b[1] ^ b[- 1] and b[-1] == b[0] ^ b[-2]:
        print("Yes")
    else:
        print("No")