from collections import Counter
N = int(input())
A = list(map(int, input().split()))
c = dict(Counter(A))
val = list(c.values())

if len(c) > 3:
    print("No")
    exit(0)
if N%3 == 0 and len(c) == 3:
    a, b, c = list(c.keys())
    if a ^ b == c and b ^ c == a and c ^ a == b:
        print("Yes")
    else:
        print("No")
elif N%3 == 0 and len(c) == 2:
    a, b = list(c.keys())
    la, lb = list(c.values())
    if (a == 0 and la*2 == lb) or (b == 0 and lb*2 == la):
        print("Yes")
    else:
        print("No")
elif len(c)==1 and list(c.keys())[0] == 0:
    print("Yes")
else:
    print("No")
