n = int(input())
list1 = list(map(int,input().split()))
list1.append(list1[0])
list1.append(list1[1])
flag = 0
for i in range(n):
  print(list1[i]^list1[i+2])
  if list1[i]^list1[i+2] != list1[i+1]:
    flag = 1
    break;
if flag != 1:
  print("Yes")
else:
  print("No")