n = gets.to_i
a = gets.split.map(&:to_i)

def yes
  puts 'Yes'
  exit
end

yes if a.all?(&:zero?)

if n % 3 == 0
  b = a.group_by(&:itself)
  cond = b.each_value.map(&:size).all? {|x| x == n/3 }
  c = b.keys
  cond &&= (c[0] == c[1] ^ c[2])
  yes if cond
end

puts 'No'
