n = int(input())
l = list(map(int,input().split()))
if not any(l):
  print("Yes")
elif n%3 or 0 in l:
  print("No")
else:
  nx = n//3
  d = dict()
  for x in l:
    if x not in d:
      d[x] = 0
    d[x] += 1
  if list(d.values()) != [nx,nx,nx]:  
    print("No")
  else:
    s = 0
    for x in d:
      s ^= x
    if s == 0:
      print("Yes")
    else:
      print("No")
