def one(L,param,num):
    if(len(param)!=0):
        if(param[0]=="0"):
            num+="1"
            if(one(L,param[1:len(param)],num)==1):return 1
        else:
            num+="0"
            if(one(L,param[1:len(param)],num)):return 1
            num=num[0:len(num)-1]
            num+="1"
            if(one(L,param[1:len(param)],num)):return 1

    else:
        if(L.count(int(num,2))!=0):
            return 1
        else:
            return 0    

N = int(input())
L = list(map(int, input().split()))


if(N%3!=0):
    print("No")
    exit()

K=len(str(format(max(L), 'b')))
L2=[0]*len(L)
for i in range(N):    
    tmp2=""
    tmp=str(format(L[i], 'b'))
    for j in range(K-len(tmp)):
        tmp2+="0"
    tmp2+=tmp
    L2[i]=tmp2

for i in range(N):
    if(one(L,L2[i],"")!=1):
        print("No")
        exit()

print("Yes")