local bxor = bit.bxor local n = io.read("*n") local a = {} local v = 0 for i = 1, n do a[i] = io.read("*n") v = bxor(v, a[i]) end if 0 < v then print("No") os.exit() end for i = 1, n do if a[i] == 0 then print("Yes") os.exit() end end local len = {} local tasks = {} local lim = 5000 for i = 1, lim do len[i] = 0 end local map = {} local edge = {} for i = 1, n do if map[a[i]] then print("Yes") os.exit() end map[a[i]] = true len[a[i]] = 1 table.insert(tasks, a[i]) table.insert(edge, a[i]) end local done = 0 while done < #tasks do done = done + 1 local src = tasks[done] -- print(src) for i = 1, #edge do local e = edge[i] if src ~= e then local dst = bxor(src, e) if dst == 0 then if len[src] + 1 < n then print("Yes") os.exit() end else if len[dst] == 1 and len[src] + len[dst] + 1 < n then -- print(src, dst, len[src], len[dst]) print("Yes") os.exit() end if len[dst] == 0 or len[src] + 1 < len[dst] then len[dst] = len[src] + 1 table.insert(tasks, dst) end end end end end -- for i = 1, lim do -- print(i, len[i]) -- end print("No")