import sys
input = sys.stdin.readline
 
def main():
  n = int(input())
  numList = []
  numList = list(map(int,input().split()))
 
  result = 'No'
 
  xor = int(numList[0]) ^ int(numList[2])
  if xor == numList[1]:
    result = 'Yes'
 
  print(result)
  
if __name__ == '__main__':
  main()