n = int(input())
a = list(map(int, input().split()))
if n%3!=0:
    print("No")
else:
    bina = []
    maxketa=0
    for i in range(len(a)):
        bina.append(format(a[i], 'b'))
        if maxketa<len(bina[i]):
            maxketa=len(bina[i])
    flag=1
    for i in range(maxketa):
        onecount=0
        for j in range(len(bina)):
            k = i-maxketa+len(bina[j])
            print(k)
            if k>=0:
                if bina[j][k]=="1":
                    onecount+=1
        print(onecount)
        if len(bina)*2/3!=onecount:
            if onecount!=0:
                flag=0
                print("No")
                break
       
    if flag==1:
        print("Yes")
        