Problem:
 Score : 300 points    Problem Statement Snuke has N hats. The i -th hat has an integer a_i written on it.  There are N camels standing in a circle.
Snuke will put one of his hats on each of these camels.  If there exists a way to distribute the hats to the camels such that the following condition is satisfied for every camel, print Yes ; otherwise, print No .   The bitwise XOR of the numbers written on the hats on both adjacent camels is equal to the number on the hat on itself.    What is XOR? The bitwise XOR x_1 \oplus x_2 \oplus \ldots \oplus x_n of n non-negative integers x_1, x_2, \ldots, x_n is defined as follows:

- When x_1 \oplus x_2 \oplus \ldots \oplus x_n is written in base two, the digit in the 2^k 's place ( k \geq 0 ) is 1 if the number of integers among x_1, x_2, \ldots, x_n whose binary representations have 1 in the 2^k 's place is odd, and 0 if that count is even.

For example, 3 \oplus 5 = 6 .      Constraints  All values in input are integers.  3 \leq N \leq 10^{5}  0 \leq a_i \leq 10^{9}         Input Input is given from Standard Input in the following format:  N  a_1  a_2  \ldots  a_{N}       Output Print the answer.        Sample Input 1 3
1 2 3      Sample Output 1 Yes   If we put the hats with 1 , 2 , and 3 in this order, clockwise, the condition will be satisfied for every camel, so the answer is Yes .        Sample Input 2 4
1 2 4 8      Sample Output 2 No   There is no such way to distribute the hats; the answer is No .

Solution (Python):
from collections import Counter

N = int(input())
a = list(map(int, input().split()))

C = Counter(a)
C_items = list(C.items())
if len(C_items) == 1:
    if C_items[0][0] == 0:
        print('Yes')
    else:
        print('No')
elif len(C_items) == 2:
    if C_items[0][0] == 0 and C_items[0][1] * 2 == C_items[1][1]:
        print('Yes')
    else:
        print('No')
elif len(C_items) == 3:
    if C_items[0][0] ^ C_items[1][0] == C_items[2][0] and C_items[0][1] == C_items[1][1] == C_items[2][1]:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Solution (Python):
n = int(input())
a = tuple(map(int, input().split()))
t = a[0]
for i in range(1, n):
  t = t ^ a[i]
print('Yes' if t == 0 else 'No')

Solution (Python):
n = int(input())
ls = list(map(int,input().split()))
ans = ls[0]
for i in range(1,n):
    ans = ans^ls[i]
if ans == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
n = input()
n = int(n)
ls = list(map(int,input().split()))

ans = ls[0]
for i in range(1,n):
  ans = ans^ls[i]
  
if ans == 0:
  print("Yes")
else:
  print("No")

Solution (Python):
def solve():
    n = int(input())
    ans = 0
    for a in map(int, input().split()):
        ans ^= a
    print("No" if ans else "Yes")
solve()

Solution (Python):
N = int(input())
A = sorted([int(a) for a in input().split()])
X = [[0] * N for _ in range(30)]

if N % 3:
    if max(A):
        print("No")
    else:
        print("Yes")
else:
    n = N//3
    if A[0] == A[n-1] and A[n] == A[2*n-1] and A[2*n] == A[3*n-1] and A[0]^A[n] == A[2*n]:
        print("Yes")
    else:
        print("No")

Solution (Python):
n=int(input())

alist = list(map(int, input().split()))
alist=sorted(alist)

judge=0

if n%3!=0:
    if alist[-1]==0:
        judge=1
    else:
        judge=0
else:
    tani=int(n/3)
    
    if alist[0]==alist[tani-1] and alist[tani]==alist[tani*2-1] and alist[tani*2]==alist[n-1]:
        
        if (alist[0]^alist[tani])==alist[tani*2]:
            judge=1
        else:
            judge=0
    else:
        judge=0

if judge==1:
    print('Yes')
else:
    print('No')

Solution (Python):

import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

N = int(input())
A = list(map(int, input().split()))
ans = "Yes"
tmp = A[0]
for a in A[1:]:
    tmp ^= a
if tmp == 0:
    ans = "Yes"
else:
    ans = "No"

print(ans)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))

m = a.pop(0)
for i in range(n-2):
    m = m ^ a[i]
print("YNeos"[m!=a[-1]::2])

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
xor = 0
for ai in a:
  xor = xor ^ ai
if xor == 0:
  print("Yes")
else:
  print("No")

Solution (Python):

n = int(input())
a = list(map(int, input().split()))
s = [0] * (n + 2)
rs = [0] * (n + 2)
for i in range(n):
    s[i + 1] = s[i] ^ a[i]
    rs[n - i] = rs[n - i + 1] ^ a[-i - 1]
ans = all(a[i] == rs[i + 2] ^ s[i] for i in range(n))
print(['No', 'Yes'][ans])

Solution (Python):
N = int(input())
A = map(int, input().split())

ans = 0
for a in A:
    ans = ans ^ a

if ans == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
N = int(input())
A = map(int, input().split(' '))

sum = 0
for a in A:
  sum = sum ^ a
  
if sum == 0:
  print('Yes')
else:
  print('No')

Solution (Python):










import sys
import os
from io import IOBase, BytesIO


def main():
    n = int(input())
    arr = get_array()
    c = 0
    for i in range(n):
        c = c ^ arr[i]
    if c == 0:
        print('Yes')
    else:
        print('No')


BUFSIZE = 8192


class FastIO(BytesIO):
    newlines = 0

    def __init__(self, file):
        self._file = file
        self._fd = file.fileno()
        self.writable = "x" in file.mode or "w" in file.mode
        self.write = super(FastIO, self).write if self.writable else None

    def _fill(self):
        s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
        self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
        return s

    def read(self):
        while self._fill():
            pass
        return super(FastIO, self).read()

    def readline(self):
        while self.newlines == 0:
            s = self._fill()
            self.newlines = s.count(b"\n") + (not s)
        self.newlines -= 1
        return super(FastIO, self).readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.getvalue())
            self.truncate(0), self.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        py2 = round(0.5)
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        if py2 == 1:
            self.write = self.buffer.write
            self.read = self.buffer.read
            self.readline = self.buffer.readline
        else:
            self.write = lambda s: self.buffer.write(s.encode("ascii"))
            self.read = lambda: self.buffer.read().decode("ascii")
            self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)


def get_array(): return list(map(int, sys.stdin.readline().split()))


def get_ints(): return map(int, sys.stdin.readline().split())


def input(): return sys.stdin.readline().strip()


if __name__ == "__main__":
    main()

Solution (Python):

from collections import Counter

n = int(input())
a = [int(x) for x in input().split()]

c = Counter(a)

ans = False
if len(c) == 1:
    ans = a[0] == 0
elif n % 3 == 0 and len(c) <= 3:
    nums = []
    for i in c:
        if c[i] % (n // 3) != 0:
            break
        else:
            nums += [i] * (c[i] // (n // 3))
    else:
        ans = (nums[0] ^ nums[1] ^ nums[2]) == 0

if ans:
    print("Yes")
else:
    print("No")

Solution (Python):

import sys

input=sys.stdin.readline
mii=lambda:map(int,input().split())

n=int(input())

a=list(mii())
a.sort()

if a[0]==a[n-1]:
    if a[0]==0:
        print("Yes")
    else:
        print("No")
elif n%3:
    print("No")
else:
    a1,a2,a3=a[0],a[n//3],a[n//3*2]
    if a1!=a[n//3-1] or a2!=a[n//3*2-1] or a3!=a[n-1]:
        print("No")
    elif a1^a2!=a3 or a1^a3!=a2 or a2^a3!=a1:
        print("No")
    else:
        print("Yes")

Solution (Python):
from sys import exit, setrecursionlimit, stderr
from functools import reduce
from itertools import *
from collections import defaultdict, Counter
from bisect import bisect

setrecursionlimit(10**6)

def read():
  return int(input())

def reads():
  return [int(x) for x in input().split()]

def answer(b):
  print("Yes" if b else "No")
  exit()

N = read()
a = reads()

d = Counter(a)
keys = list(d.keys())
keys.sort()

if len(keys) > 3:
  answer(False)

if len(keys) == 1:
  answer(keys[0] == 0)
elif len(keys) == 2:
  if keys[0] != 0:
    answer(False)
  v = keys[1]
  answer(d[0] * 2 == d[v])
else:
  assert len(keys) == 3
  v, w, x = keys
  if v ^ w == x and d[v] == d[w] == d[x]:
    answer(True)
  else:
    answer(False)

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
ans = a[0]
for i in range(1,n):
    ans = ans^a[i]

if (ans == 0):
    print("Yes")
else:
    print("No")

Solution (Python):

from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
from functools import reduce
import sys
import math
import bisect
import random
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return list(map(float, sys.stdin.readline().split()))
def LS():return sys.stdin.readline().split()
def SR(n): return [list(sys.stdin.readline())[:-1] for i in range(n)]
def IR(n): return [int(sys.stdin.readline()) for i in range(n)]
def LIR(n): return [list(map(int, sys.stdin.readline().split())) for i in range(n)]
def LSR(n): return [list(map(list, sys.stdin.readline().split())) for i in range(n)]
_gcd = lambda x, y: _gcd(y, x%y) if (x%y) else y
_lcm = lambda x, y: x*y // _gcd(x, y)
def gcd(*numbers):
    return reduce(_gcd, numbers)
def lcm(*numbers):
    return reduce(_lcm, numbers)
sys.setrecursionlimit(1000000)
INF = float('inf')
mod = 1000000007
dire4 = [(1,0), (0,1), (-1,0), (0,-1)]
dire8 = [(1, 0), (1, 1), (0, 1), (-1, 1), (-1, 0), (-1, -1), (0, -1), (1, -1)]

N = I()
a = LI()

ret = 0
for ai in a[1:]:
    ret ^= ai

print("Yes" if (ret==a[0]) else "No")

Solution (Python):
n = int(input())
a = list(map(int, input().split()))

xor = a[0]
for i in range(len(a)-1):
    xor = xor^a[i+1]

if(xor == 0):
    print('Yes')
else:
    print('No')

Solution (Python):
N = int(input())
A = list(map(int,input().split()))

a = A[0]
for i in range(1,N):
    a ^= A[i]
if a == 0: print('Yes')
else: print('No')

Solution (Python):
from collections import Counter


def solve(n, aaa):
    if all(a == 0 for a in aaa):
        return True

    if n % 3 != 0:
        return False

    cnt = list(Counter(aaa).items())
    if len(cnt) == 2:
        (a1, c1), (a2, c2) = cnt
        if c1 > c2:
            c1, c2 = c2, c1
        if c1 != n // 3 or c2 != n * 2 // 3:
            return False
        return a1 == 0

    if len(cnt) == 3:
        if any(c[1] != n // 3 for c in cnt):
            return False
        a1, a2, a3 = (c[0] for c in cnt)
        return a1 ^ a2 == a3

    return False


n = int(input())
aaa = list(map(int, input().split()))
print('Yes' if solve(n, aaa) else 'No')

Solution (Python):
n = int(input())
a_list = list(map(int, input().split()))
xor = 0
for a in a_list:
    xor ^= a
if xor == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
N = int(input())
a = list(map(int, input().split()))

a_xor = 0
for i in a:
  a_xor ^= i
if a_xor == 0:
  print("Yes")
else:
  print("No")

Solution (Python):
N = int(input())
lst = list(map(int, input().split()))
ans = 0
for i in range(N):
    ans = ans ^ lst[i]

if ans == 0:
    print ('Yes')
else:
    print ('No')

Solution (Python):
N=int(input())
a=list(map(int,input().split()))
L=[str(bin(i))[2:] for i in a]
dic=dict([(i,0) for i in range(32)])
for s in L:
    for i,c in enumerate(s[::-1]):
        if c=='1':
            dic[i]+=1
for i in dic.values():
    if i%2==1:
        print("No")
        exit(0)
else:
    print("Yes")

Solution (Python):
N = int(input())
a = [int(x) for x in input().split()]

dp = 0
for ai in a:
    dp ^= ai

if dp == 0:
    print("Yes")
else:
    print("No")

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
a.append(a[0])
a.insert(0, a[-2])

ans = 0

for i in range(n):
    ans ^= a[i]

if ans == 0:
    print("Yes")
else:
    print("No")

Solution (Python):
n = int(input())
a = list(map(int, input().split()))

x = a[0]
for i in range(1, n):
    x ^= a[i]

if x == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
N = int(input())
A = map(int,input().split())

ans = 0
for a in A:
    ans = ans ^ a
if ans == 0:
    print("Yes")
else:
    print("No")

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
s=a[0]
for i in range(1,n):
    s=s^a[i]
if s==0:
    print('Yes')
else:
    print('No')

Solution (Python):

from functools import reduce
def xor(a,b):
    return a^b
N = int(input())
ls = list(map(int,input().split()))
ans = reduce(xor,ls)
if ans==0:
    print ("Yes")
else:
    print ("No")

Solution (Python):
n = int(input())
nums = list(map(int, input().split()))

unq = list(set(nums))


def answer(ans):
    print(ans)
    exit()

if len(unq) > 3:answer("No")

if len(unq) == 3:
    a,b,c = unq
    if a ^ b ^ c != 0:answer("No")
    if nums.count(a) == nums.count(b) == nums.count(c):answer("Yes")
    else:answer("No")

if len(unq) == 2:
    a,b = sorted(unq)
    if a != 0:answer("No")
    if nums.count(a) * 2 == nums.count(b):answer("Yes")
    else: answer("No")

if len(unq) == 1:
    a = unq[0]
    if a != 0:answer("No")
    else:answer("Yes")

Solution (Python):
n=int(input())
arr=list(map(int,input().split()))
cnt=[0]*40
for val in arr:
  tbit=format(val,'b')[::-1]
  for i in range(len(tbit)):
    if tbit[i]=='1':
      cnt[i]+=1
for val in cnt:
  if val%2==1:
    print('No')
    break
else:
  print('Yes')

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
if N%2==1:
    s = 0
    for a in A:
        s^=a
    if s==0:
        print("Yes")
    else:
        print("No")
else:
    s1 = 0
    for a in A[::2]:
        s1 ^= a
    s2 = 0
    for a in A[1::2]:
        s2 ^= a
    if s1 == s2 == 0:
        print("Yes")
    else:
        print("No")

Solution (Python):
N = int(input())
A = list(map(int, input().split(" ")))

m = A[0]
for i in range(1, N):
    m ^= A[i]

if m == 0:
    print("Yes")
else:
    print("No")

Solution (Python):
n = int(input())
dat_a = map(int, input().split())
dat_a = list(dat_a)
res = dat_a[0]
for i in range(1,n):
    res ^= dat_a[i]
print("Yes" if res == 0 else "No")

Solution (Python):
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    a = list(map(int, input().split()))
    tmp = 0
    for i in range(N):
        tmp ^= a[i]
    if tmp == 0:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
A = list(map(int, input().split()))

tmp = 0
for a in A:
  tmp = tmp ^ a

ans = "No"
if tmp == 0:
  ans = "Yes"
print(ans)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
ans = a[0] ^ a[1]
for i in range(2, n):
    ans ^= a[i]
if ans == 0:
    print("Yes")
else:
    print("No")

Solution (Python):
def solve():
  N = int(input())
  A = [int(i) for i in input().split()]
  v = 0
  for a in A: v^= a
  return 'Yes' if v == 0 else 'No'

print(solve())

Solution (Python):
n = int(input())

A = list(map(int, input().split()))

ans = A[0]

for i in range(1, n):
    ans ^= A[i]

if ans == 0:
    print('Yes')

else:
    print('No')

Solution (Python):
n = int(input())
a  = list(map(int, input().split()))
ans = 0
for i in range(n):
  ans ^= a[i]
if ans:
  print("No")
else:
  print("Yes")

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
xor = 0
for num in a:
    xor ^= num
if xor == 0:
    print('Yes')
else:
    print('No')

Solution (Python):

import sys
from operator import itemgetter
from fractions import gcd
from math import ceil, floor, sqrt
from copy import deepcopy
from collections import Counter, deque
import heapq
from functools import reduce
sys.setrecursionlimit(200000)





input = sys.stdin.readline
def ii(): return int(input())
def mi(): return map(int, input().rstrip().split())
def lmi(): return list(map(int, input().rstrip().split()))
def li(): return list(input().rstrip())
def debug(*args, sep=" ", end="\n"): print("debug:", *args, file=sys.stderr, sep=sep, end=end) if not __debug__ else None
def exit(*arg): print(*arg); sys.exit()



def main():
    N = ii()
    A = lmi()
    a = 0
    for i in range(N):
        a = a ^ A[i]
    if a != 0:
        print('No')
    else:
        print('Yes')


if __name__ == '__main__':
    main()

Solution (Python):
n=int(input())
p=input().rstrip().split(' ')
xor = 0;
for i in range(0,len(p)):
    xor = xor^int(p[i])
if xor==0:
    print("Yes")
else:
    print("No")

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
s = 0
for i in range(n):
  s ^= a[i]
if s == 0:
  print('Yes')
else:
  print('No')

Solution (Python):
n=int(input())
s=[int(i) for i in input().split()]
a=1
for l in s:
    a^=l
if a==1:
    print("Yes")
else:
    print("No")

Solution (Python):

from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')


def A():
    n = II()
    a = LI()
    x = a[0]
    for i in a[1:]:
        x = x ^ i
    if x:
        print("No")
    else:
        print("Yes")
    return


def B():
    return


def C():
    return


def D():
    return


def E():
    return


def F():
    return


def G():
    return


def H():
    return


if __name__ == '__main__':
    A()

Solution (Python):

from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007


def A():
    n = I()
    a = LI()
    ans = 0
    for i in a:
        ans ^= i
    if not ans:
        print("Yes")
    else:
        print("No")
    return


def B():
    n = I()

    return


def C():
    n = I()

    return


def D():
    n = I()

    return


def E():
    n = I()

    return


def F():
    n = I()

    return


if __name__ == "__main__":
    A()