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

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

S=[""]*3
for i in range(3):
    temp=A[i]
    while temp>0:
        S[i]=str(temp%2)+S[i]
        temp=temp//2

mx=max(len(S[0]),len(S[1]),len(S[2]))
S1=[""]*3
for i in range(3):
    S1[i]=S[i].zfill(mx)

temp=""
for i in range(mx):
    if S1[0][i]==S1[1][i]:
        temp=temp+"0"
    else:
        temp=temp+"1"

if S[2]==temp:
    print("Yes")
else:
    print("No")