local function getxor(x, y)
  local ret = 0
  local mul = 1
  while 0 < x or 0 < y do
    if (x % 2) + (y % 2) == 1 then
      ret = ret + mul
    end
    x, y, mul = x // 2, y // 2, mul * 2
  end
  return ret
end

local n = io.read("*n")
local a = {}
local allzero = true
local t = {}
local tcnt = 0
for i = 1, n do
  a[i] = io.read("*n")
  if a[i] ~= 0 then allzero = false end
  if t[a[i]] then
    t[a[i]] = t[a[i]] + 1
  else
    if tcnt < 3 then
      tcnt = tcnt + 1
      t[a[i]] = 1
    else
      tcnt = 4
    end
  end
end
if allzero then
  print("Yes")
elseif n % 3 ~= 0 then
  print("No")
elseif tcnt == 3 then
  local f = true
  local g = {}
  for k, v in pairs(t) do
    if v ~= n // 3 then f = false end
    table.insert(g, k)
  end
  if f then
    f = getxor(g[1], g[2]) == g[3]
  end
  print(f and "Yes" or "No")
elseif tcnt == 2 then
  local f = true
  for k, v in pairs(t) do
    if v == n // 3 and k == 0 then
    elseif v == n * 2 // 3 then
    else f = false
    end
  end
  print(f and "Yes" or "No")
else
  print("No")
end
