from collections import Counter 
import sys
def No():
    print("No")
    sys.exit()

def Yes():
    print("Yes")
    sys.exit()

N=int(input())
A = [int(i) for i in input().split()]
C=Counter(A)
if N%3==0:
    if len(C)==1:
        if C.get(0,0):
            Yes()
        else:No()
    if len(C)==2:
        if C.get(0,0) == N//3:
            Yes()
        else:No()
    if len(C)!=3:No()
    bits = [format(a,"040b") for a in C.keys()]
    if all([z.count("0")%2 for z in zip(*bits)]):
        print("Yes")
    else:No()
else:
    if len(C)==1 and C.get(0,0):
        Yes()
    else:No()