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