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