import sequtils, strutils, tables

let
  n = stdin.readline.parseInt
  bs = stdin.readline.split.map(parseInt)
var
  counter = initCountTable[int]()

for b in bs:
  counter.inc(b)

var ok = true

block check:
  if len(counter) == 3:
    var tmp = 0
    for k,v in counter:
      tmp = tmp xor k
      if v != n div 3:
        ok = false
        break check
    if tmp != 0:
      ok = false
      break check
  elif len(counter) == 2:
    if not counter.hasKey(0):
      ok = false
      break check
    for k,v in counter:
      if v != n div 2:
        ok = false
        break check
  elif len(counter) == 1:
    if not counter.hasKey(0):
      ok = false
      break check
  else:
    ok = false
    break check

if ok:
  echo "Yes"
else:
  echo "No"
