import copy
a=int(input())
b=(list(map(int, input().split())))
bb = copy.copy(b)
c=0
d=[]
n=0
f=b[0]
d.append(f)
b.pop(0)
print(1^2)
print(2^3)
print(3^1)

def kakunin(bb,d):
  while c==0:
    cc=0
    for i in range(len(bb)):
      print(d)
      if d[len(d)-2]==d[len(d)-1]^bb[i]:
        g=bb[i]
        d.append(g)
        bb.pop(i)
        cc=1
        if len(d)==a and d[0]==d[len(d)-2]^d[len(d)-1]:
          global ccc
          ccc=1
          return
        break
    if cc==0:
      ccc=0
      return
      
while c==0:
  n+=1    
  bb = copy.copy(b)
  f=b[0]
  d.append(f)
  b.pop(0)
  bb.pop(0)
  kakunin(bb,d)
  b.append(f)
  if ccc==1:
    print("Yes")
    break
  else:
    d=[f]
  if n>=a:
    print("No")
    break