from collections import Counter
N = int(input())
a = [int(i) for i in input().split()]

c = Counter(a)

if c[0] == N:
    print("Yes")
    exit()

if N % 3 == 0 and c[0] == N // 3 and len(c.values()) == 2:
    print("Yes")
    exit()

n =  N // 3
k = list(c.keys())
v = list(c.values())
print(k)
if N % 3 == 0 and v == [n, n, n] and k[0]^k[1]^k[2] == 0:
    print("Yes")
    exit()

print("No")