CodeEff/ECCO huggingface dataset:
# Original solution
# coding: utf-8
N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
d = {}
for i in range(N):
    a = A[i]
    if a not in list(d.keys()):
        d[a] = 1
    else:
        d[a] += 1
if len(list(d.keys())) == 1:
    if list(d.keys())[0] == 0:
        print("Yes")
    else:
        print("No")
elif len(list(d.keys())) == 2:
    keys = list(sorted(list(d.keys())))
    if d[keys[0]] == N // 3:
        print("Yes")
    else:
        print("No")
elif len(list(d.keys())) == 3:
    keys = list(d.keys())
    if keys[0] ^ keys[1] ^ keys[2] == 0:
        if d[keys[0]] == d[keys[1]] == d[keys[2]]:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")

# Optimized solution
# coding: utf-8
N = int(eval(input()))
A = list(map(int, input().split()))
# A.sort()
d = {}
for i in range(N):
    a = A[i]
    if a not in list(d.keys()):
        d[a] = 1
    else:
        d[a] += 1
flag = True
if len(list(d.keys())) == 1:
    if list(d.keys())[0] == 0:
        flag = True
    else:
        flag = False
elif len(list(d.keys())) == 2:
    keys = list(sorted(list(d.keys())))
    if d[keys[0]] == N // 3:
        flag = True
    else:
        flag = False
elif len(list(d.keys())) == 3:
    keys = list(d.keys())
    if keys[0] ^ keys[1] ^ keys[2] == 0:
        if d[keys[0]] == d[keys[1]] == d[keys[2]]:
            flag = True
        else:
            flag = False
    else:
        flag = False
else:
    flag = False
print(("Yes" if flag else "No"))
# Original solution
from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf,comb
from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from queue import Queue,LifoQueue,PriorityQueue
from copy import deepcopy
from time import time
from functools import reduce
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(eval(input()))
def MAP()   : return list(map(int,input().split()))
def LIST()  : return list(MAP())

n = INT()
a = LIST()
c = Counter(a).most_common()

if len(c) == 3 and c[0][1] == c[1][1] == c[2][1]:
    x = c[0][0]
    y = c[1][0]
    z = c[2][0]
    if x^y == z and y^z == x and z^x == y:
        ans = "Yes"
    else:
        ans = "No"
elif len(c) == 2 and c[0][1] == 2*c[1][1]:
    x = c[0][0]
    y = c[1][0]
    if x^x == y and x^y == x:
        ans = "Yes"
    else:
        ans = "No"
elif len(c) == 1 and c[0][0] == 0:
    ans = "Yes"
else:
    ans = "No"

print(ans)

# Optimized solution
from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf,comb
from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from queue import Queue,LifoQueue,PriorityQueue
from copy import deepcopy
from time import time
from functools import reduce
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(eval(input()))
def MAP()   : return list(map(int,input().split()))
def LIST()  : return list(MAP())

n = INT()
a = LIST()
c = Counter(a).most_common()

if len(c) == 3 and c[0][1] == c[1][1] == c[2][1]:
    x = c[0][0]
    y = c[1][0]
    z = c[2][0]
    if x^y^z == 0:
        ans = "Yes"
    else:
        ans = "No"
elif len(c) == 2 and c[0][1] == 2*c[1][1]:
    x = c[0][0]
    y = c[1][0]
    if x^x^y == 0:
        ans = "Yes"
    else:
        ans = "No"
elif len(c) == 1 and c[0][0] == 0:
    ans = "Yes"
else:
    ans = "No"

print(ans)
# Original solution
n=int(eval(input()))
a=sorted([int(i) for i in input().split()])
m,k=n//3,0
for i in range(n):
  d=i%3*m+i//3
  if a[d]^a[(d+2*m)%n]!=a[(d+m)%n]:
    k=1
print(('YNeos'[k::2]))

# Optimized solution
n=int(eval(input()))
a=sorted([int(i) for i in input().split()])
m=n//3
print(('YNeos'[(a[0],a[m],a[-m])!=(a[m-1],a[-m-1],a[-1]) or a[0]^a[m]!=a[-m]::2]))
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))
for i in range(N):
  A[i] = bin(A[i])
max_len = len(A[N-1]) - 2
for i in range(N):
  A[i] = A[i][2:].zfill(max_len)
check = True
for i in range(max_len):
  count0 = 0
  count1 = 0
  for j in range(N):
    if(A[j][i] == '0'):
      count0 += 1
    else:
      count1 += 1
  if(count1 == 0):
    continue
  elif(count1 == count0 * 2):
    continue
  else:
    check = False
    break
if(check):
  print('Yes')
else:
  print('No')

# Optimized solution
n = int(eval(input()))
nums = list(map(int, input().split()))
#set型にしてからlistにキャストすることで，複数存在するものを省いている
unq = list(set(nums))

#違う数字が4個以上存在したら，正しい答えは存在しない
if len(unq) > 3:
  print("No")

if len(unq) == 3:
    #list,unqをアンパックしてa,b,cにいれている
    a,b,c = unq
    if a ^ b ^ c == 0:
      if nums.count(a) == nums.count(b) == nums.count(c):
        print("Yes")
      else:
        print("No")
    else:
      print("No")

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

if len(unq) == 1:
    a = unq[0]
    if a != 0:
      print("No")
    else:
      print("Yes")
# Original solution
N = int(eval(input()))
A = list(map(int,input().split()))
B = set(A)
C = list(B)
k = len(C)
if N%3==0:
    if k==3 and C[0]^C[1]==C[2] and A.count(C[0])==A.count(C[1]) and A.count(C[0])==A.count(C[2]):
        print("Yes")
    elif k==2:
        C = sorted(C)
        if C[0]==0 and A.count(C[0])==N//3:
            print("Yes")
        else:
            print("No")
    elif k==1 and C[0] == 0:
        print("Yes")
    else:
        print("No")
else:
    if k==1 and C[0] ==0:
        print("Yes")
    else:
        print("No")

# Optimized solution
N = int(eval(input()))
A = list(map(int,input().split()))
C = {}
for i in range(N):
    if A[i] not in C:
        C[A[i]] = 0
    C[A[i]] += 1
if len(C)>3:
    print("No")
else:
    if N%3==0:
        if 0 in C:
            if len(C)==1:
                print("Yes")
            elif len(C)==2:
                if C[0]==N//3:
                    print("Yes")
                else:
                    print("No")
            else:
                print("No")
        else:
            if len(C)!=3:
                print("No")
            else:
                flag = 0
                for a in C:
                    if C[a]!=N//3:
                        flag = 1
                        break
                if flag==0:
                    C = list(C.keys())
                    if C[0]^C[1]==C[2]:
                        print("Yes")
                    else:
                        print("No")
                else:
                    print("No")
    else:
        if len(C)==1 and 0 in C:
            print("Yes")
        else:
            print("No")
# Original solution
import sys

input = sys.stdin.readline


def check(n, nums):
    kind = set(nums)
    if len(kind) > 3:
        return False
    if len(kind) == 1 and 0 in kind:
        return True
    if n % 3 != 0:
        return False
    if len(kind) == 3:
        a, b, c = kind
        return nums.count(a) == nums.count(b) == nums.count(c) and a ^ b ^ c == 0
    else:
        return 0 in kind and n / 3 == nums.count(0)


def main():
    n = int(eval(input()))
    a_list = [int(i) for i in input().split()]
    print(("Yes" if check(n, a_list) else "No"))
    # 0 0 0
    # 1 0 1 1 0 1
    # 1 2 3


if __name__ == "__main__":
    main()


# Optimized solution
import sys

input = sys.stdin.readline


def check(n, nums):
    kind = set(nums)

    if len(kind) > 3:
        return False

    if len(kind) == 1 and 0 in kind:
        return True

    if n % 3 != 0:
        return False

    if len(kind) == 3:
        if len(set([nums.count(k) for k in kind])) != 1:
            return False
        kind = list(kind)
        if kind[0] ^ kind[1] ^ kind[2] == 0:
            return True
        else:
            return False
    else:
        if 0 not in kind:
            return False
        elif n / 3 != nums.count(0):
            return False
        else:
            return True


def main():
    n = int(eval(input()))
    a_list = [int(i) for i in input().split()]
    print(("Yes" if check(n, a_list) else "No"))


if __name__ == "__main__":
    main()
# Original solution
import sys
input = sys.stdin.readline

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


# Optimized solution
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n, *a = list(map(int, read().split()))
for af in a[1:]:
    a[0] ^= af
print(('Yes' if a[0] == 0 else 'No'))
# Original solution
import copy

N=int(eval(input()))
a=list(map(int,input().split()))
A={}
for h in range(N):
    if a[h] in A:
        A[a[h]]+=1
    else:
        A[a[h]]=1
A[a[0]]-=1
ans="No"
for i in range(1,N):
    temp=copy.copy(A)
    P=[a[0],a[i]]
    temp[a[i]]-=1
    for j in range(2,N):
        x=P[j-2]^P[j-1]
        if x in temp and temp[x]>0:
            P.append(x)
            temp[x]-=1
        else:
            break
    if len(P)==N:
        if P[-2]^P[-1]==P[0] and P[-1]^P[0]==P[1]:
            ans="Yes"
            break
print(ans)

# Optimized solution
N=int(eval(input()))
a=list(map(int,input().split()))

d={}
for h in range(1,N):
    if a[h] in d:
        d[a[h]]+=1
    else:
        d[a[h]]=1
ans="Yes"
b=[a[0]]

for h in range(1,N):
    t=a[h]^a[0]
    if t in d:
        b.append(a[h])
        d[a[h]]-=1
        if d[a[h]]==0:
            del d[a[h]]
        break
    if h==N-1:
        ans="No"

if ans=="Yes":
    for i in range(1,N+1):
        if i==h:
            continue
        if i==N:
            t=b[-1]^b[-2]
            if t!=b[0]:
                ans="No"
            break
        t=b[-1]^b[-2]
        if t in d:
            b.append(t)
            d[t]-=1
            if d[t]==0:
                del d[t]
        else:
            ans="No"
            break

print(ans)
# Original solution
N=int(eval(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 list(dic.values()):
    if i%2==1:
        print("No")
        exit(0)
else:
    print("Yes")



# Optimized solution
N=int(eval(input()))
A=list(map(int,input().split()))
sA=set(A)
flg=0
if all([x==0 for x in A]):
    flg=1
elif len(sA)==2 and N%3==0:
    a,b=[A.count(x) for x in sA]
    if min(a,b)==N//3 and max(a,b)==N//3*2:
        flg=1
elif len(sA)==3 and N%3==0:
    a,b,c=[x for x in sA]

    if a^b^c==0 and  all([A.count(x)==N//3 for x in sA]):
        flg=1
print(("Yes" if flg==1 else "No"))
# Original solution
from functools import*;_,a=open(0);print(('YNeos'[reduce(lambda x,y:x^y,list(map(int,a.split())))>0::2]))

# Optimized solution
_,a=open(0);a,*b=list(map(int,a.split()))
for b in b:a^=b
print(('YNeos'[a>0::2]))
# Original solution
def main():
    import sys
    import collections
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    a = collections.Counter(list(map(int, input().rstrip('\n').split()))).most_common()
    if len(a) == 3:
        if a[0][0] ^ a[1][0] ^ a[2][0] == 0 and a[0][1] == a[1][1] == a[2][1]:
            print("Yes")
            exit()
    elif len(a) == 2:
        if (a[0][0] == 0 and a[1][1] == a[0][1] * 2) or (a[1][0] == 0 and a[0][1] == a[1][1] * 2):
            print("Yes")
            exit()
    elif len(a) == 1 and a[0][0] == 0:
        print("Yes")
        exit()
    print("No")


if __name__ == '__main__':
    main()


# Optimized solution
import sys
import collections


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n = int(readline())
    a = list(map(int, readline().split()))
    a = collections.Counter(a).most_common()
    if len(a) == 1:
        if a[0][0] == 0:
            print("Yes")
        else:
            print("No")
    elif len(a) == 2:
        if a[0][1] == a[1][1] * 2 and a[1][0] == 0:
            print("Yes")
        else:
            print("No")
    elif len(a) == 3:
        if a[0][0] ^ a[1][0] ^ a[2][0] == 0 and a[0][1] == a[1][1] == a[2][1]:
            print("Yes")
        else:
            print("No")
    else:
        print("No")


if __name__ == '__main__':
    solve()
# Original solution
def f(t,T):
    if t in T:
        return T[t]
    else:
        return 0

from copy import copy

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

T={}
for a in A[1:]:
    if a in T:
        T[a]+=1
    else:
        T[a]=1

F=True
for i in range(1,N):
    a,b=A[0],A[i]
    X=[a,b]+[0]*(N-2)

    U=copy(T)
    U[b]-=1

    G=True
    for k in range(N-2):
        c=a^b
        if f(c,U)>0:
            U[c]-=1
            X[k+2]=c
            a,b=b,c
        else:
            G=False
            break

    if G and X[-2]^X[-1]==X[0] and X[-1]^X[0]==X[1]:
        print("Yes")
        exit()

print("No")

# Optimized solution
N=int(eval(input()))
A=list(map(int,input().split()))

T={}
for a in A:
    if a in T:
        T[a]+=1
    else:
        T[a]=1

F=True
for x in T:
    F&=(3*T[x]%N==0)

if not F:
    print("No")
    exit()

M=max(T,key=lambda x:T[x])
if 3*T[M]==N:
    x,y,z=list(T.keys())
elif 3*T[M]==2*N:
    x=y=M
    del T[M]
    z=tuple(T.keys())[0]
else:
    x=y=z=M

if x^y==z:
    print("Yes")
else:
    print("No")
# Original solution
import sys
inputs = sys.stdin.readlines()

N = int(inputs[0])
a_list = list(map(int, inputs[1].split()))

from collections import Counter

def all_zeros(a_list):
    return sum(a_list) == 0

def check(N, a_list):
    if all_zeros(a_list):
        print('Yes')
        return
    elif N % 3 == 0:
        x = N // 3
        if not all([v % x == 0 for v in list(Counter(a_list).values())]):
            print('No')
            return
        while not all_zeros(a_list):
            counter = Counter([a & 1 for a in a_list])
            if counter[0] == x or counter[0] == N:
                a_list = [a >> 1 for a in a_list]
            else:
                print('No')
                return
        print('Yes')
    else:
        print('No')

check(N, a_list)

# Optimized solution
import sys
inputs = sys.stdin.readlines()

from collections import Counter

N = int(inputs[0])
a_list = list(map(int, inputs[1].split()))

def check(N, a_list):
    mc = Counter(a_list).most_common()
    n = len(mc)
    if n == 1:
        if mc[0][0] == 0:
            print('Yes')
            return
    elif n == 2:
        if mc[0][1] == 2*N // 3 and mc[1][0] == 0:
            print('Yes')
            return
    elif n == 3:
        if mc[0][1] == mc[1][1] == mc[2][1] and mc[0][0] ^ mc[1][0] ^ mc[2][0] == 0:
            print('Yes')
            return
    print('No')

check(N, a_list)
# Original solution
from copy import copy
from collections import Counter
n = int(eval(input()))
a = list(map(int, input().split()))
d = Counter(a)

#print(d)
for i in range(1, n):
    one = prev = a[0]
    two = cur = a[i]
    dd = copy(d)
    end = True
    for j in range(n-2):
        nxt = prev^cur
        if dd[nxt] >0:
            dd[nxt] -= 1
        else:
            end = False
            break
        prev = cur
        cur = nxt
    if end and prev^cur == one and dd[one] > 0 and cur^one == two and dd[two] > 0:
        print("Yes")
        exit()
print("No")

# Optimized solution
from collections import Counter
from functools import reduce
n = int(eval(input()))
a = list(map(int, input().split()))
c = Counter(a)
if (len(c) == 1 and c[0] == n) or (len(c) == 2 and c[0] == n//3 and c[max(c.keys())] == 2*n//3) or (len(c) == 3 and reduce(lambda x, y: x^y, list(c.keys())) == 0 and set(c.values()) == set([n//3])):
    print("Yes")
else:
    print("No")
# Original solution
N = int(eval(input()))
a = list(map(int, input().split()))
flag = False

for i in range(len(a)):
  ta = a.pop(i)
  sum_xor = 0
  for _a in a:
    sum_xor = sum_xor ^ _a
  if sum_xor==ta:
    flag = True
    break
  a.append(ta)

if flag:
  print('Yes')
else:
  print('No')

# Optimized solution
N = int(eval(input()))
a = list(map(int, input().split()))
flag = False

sum_xor = 0
for _a in a:
  sum_xor = sum_xor ^ _a

if sum_xor==0:
  print('Yes')
else:
  print('No')
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))

import sys
from collections import Counter
d = Counter(A)

if d[0] == N:
    print("Yes")
    sys.exit()

if d[0] == N // 3:
    for x in list(d.keys()):
        if d[x] == 2 * N // 3:
            print("Yes")
            sys.exit()

# print(d)
third = N // 3
# print(third)
cand = list([x for x in A if d[x] == third])
# print(cand)
for ix1 in range(len(cand)):
    for ix2 in range(ix1 + 1, len(cand)):
        for ix3 in range(ix2 + 1, len(cand)):
            if cand[ix1] ^ cand[ix2] ^ cand[ix3] == 0:
                print("Yes")
                sys.exit()

print("No")

# Optimized solution
N = int(eval(input()))
A = list(map(int, input().split()))

import sys
from collections import Counter
d = Counter(A)

if d[0] == N:
    print("Yes")
    sys.exit()

if d[0] == N // 3:
    for x in list(d.keys()):
        if d[x] == 2 * N // 3:
            print("Yes")
            sys.exit()

third = N // 3
if len(list(d.keys())) == 3:
    a, b, c = list(d.keys())
    if d[a] == d[b] and d[b] == d[c]:
        if a ^ b ^ c == 0:
            print("Yes")
            sys.exit()

print("No")
# Original solution
def f(n, D, p, q):
    for i in range(n-2):
        r = p ^ q
        if (r in D) and (D[r] > 0):
            D[r] -= 1
        else:
            return -1
        p, q = q, r
    return p ^ q

def solve(n, a):
    D = {}
    for x in a:
        if not x in D:
            D[x] = 0
        D[x] += 1
    D[a[0]] -= 1
    for i in range(1, n):
        D[a[i]] -= 1
        ok = f(n, D.copy(), a[0], a[i]) == a[0]
        D[a[i]] += 1
        if ok:
            return "Yes"
    return "No"

n = int(eval(input()))
a = list(map(int, input().split()))
print((solve(n, a)))

# Optimized solution
def solve(n, a):
    p = 0
    for x in a:
        p ^= x
    return "Yes" if p == 0 else "No"

n = int(eval(input()))
a = list(map(int, input().split()))
print((solve(n, a)))
# Original solution
import collections

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

C = collections.Counter(a)
L = len(C)
e = list(C.keys())
if (L == 1) and (C[0] > 0):
    print("Yes")
elif (L == 2) and (C[e[0]] * 2 == C[e[1]]):
    print((((e[0] ^ e[0] == e[1]) or (e[1] ^ e[1] == e[0])) and "Yes" or "No"))
elif (L == 3) and (C[e[0]] == C[e[1]]) and (C[e[1]] == C[e[2]]):
    print((((e[0] ^ e[1]) == e[2]) and "Yes" or "No"))
else:
    print("No")


# Optimized solution
import collections

N = int(eval(input()))
a = list(map(int, input().split()))
C = collections.Counter(a)
L = len(C)
e = list(C.keys())
if (L == 1) and (C[0] > 0):
    print("Yes")
elif (L == 2) and (C[e[0]] * 2 == C[e[1]]):
    print((((e[0] ^ e[0] == e[1]) or (e[1] ^ e[1] == e[0])) and "Yes" or "No"))
elif (L == 3) and (C[e[0]] == C[e[1]]) and (C[e[1]] == C[e[2]]):
    print((((e[0] ^ e[1]) == e[2]) and "Yes" or "No"))
else:
    print("No")
# Original solution
from functools import reduce
from collections import Counter


N = int(eval(input()))
a = list(map(int, input().split()))
if N % 3 and a != [0] * N:
    print("No")
    exit()

nums = Counter(a)
ks = sorted(nums)
vs = sorted(nums.values())
if (
    (len(nums) == 1 and ks[0] == 0)
    or (len(nums) == 2 and ks[0] == 0 and vs[0] == N // 3)
    or (
        len(nums) == 3
        and all(v == N // 3 for v in vs)
        and reduce(lambda x, y: x ^ y, ks) == 0
    )
):
    print("Yes")
else:
    print("No")


# Optimized solution
N, *A = map(int, open(0).read().split())
A_set = set(A)

if len(A_set) == 1:
    print("Yes") if sum(A) == 0 else print("No")
elif len(A_set) == 2:
    a1, a2 = sorted(A_set)
    print("Yes") if a1 == 0 and A.count(a1) * 3 == N else print("No")
elif len(A_set) == 3:
    a1, a2, a3 = list(A_set)
    if a1 ^ a2 ^ a3 == 0 and A.count(a1) == A.count(a2) == A.count(a3):
        print("Yes")
    else:
        print("No")
else:
    print("No")
# Original solution
n = int(eval(input()))
a = list(map(int,input().split()))

a = sorted(a,reverse=True)

for ai in a[1:]:
  gen = [a[0]]
  gen.append(ai)
  for j in range(2,n):   
    gen.append(gen[j-2]^gen[j-1])

if (set(gen)==set(a)):
  print('Yes')
else:
  print('No')    

# Optimized solution
n = int(eval(input()))
A = list(map(int,input().split()))

A = sorted(A, reverse=True)
xor = A[0]
for a in A[1:]:
  xor ^= a 
if (xor == 0):
  print('Yes')
else:
  print('No')
# Original solution
from itertools import permutations
n=int(eval(input()))
N=list(map(int,input().split()))
ans=[]
for i in list(permutations(N)):
    flag=1
    i=list(i)
    i.insert(0,i[-1])
    i.append(i[1])
    for j in range(1,n):
        if i[j]!=i[j-1]^i[j+1]:
            flag=0
            break
    if flag==1:break

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

# Optimized solution
N=int(eval(input()))
A = list(map(int,input().split()))
temp = 0
for i in A:
    temp = temp ^ i
if(temp == 0):
    print('Yes')
else:
    print('No')
# Original solution
from collections import Counter
n = int(eval(input()))
a = [int(x) for x in input().split()]

if n % 3:
    print(('Yes' if len(set(a)) == 1 else 'No'))
else:
    d = Counter()
    for x in a:
        d[x] += 1
    if len(list(d.keys())) == 1:
        print(('Yes' if d[0] == n else 'No'))
    elif len(list(d.keys())) == 2:
        print(('Yes' if d[0] == n//3 else 'No'))
    elif len(list(d.keys())) == 3:
        p, q, r = list(d.keys())
        if d[p] == d[q] and d[q] == d[r] and p ^ q ^ r == 0:
            print('Yes')
        else:
            print('No')
    else:
        print('No')


# Optimized solution
from collections import Counter
n = int(eval(input()))
a = [int(x) for x in input().split()]

d = Counter()
for x in a:
    d[x] += 1

if d[0] == n:
    print('Yes')
elif len(list(d.keys())) == 2 and d[0] == n//3:
    print(('Yes' if d[0] == n//3 else 'No'))
elif len(list(d.keys())) == 3:
    p, q, r = list(d.keys())
    if d[p] == d[q] and d[q] == d[r] and p ^ q ^ r == 0:
        print('Yes')
    else:
        print('No')
else:
    print('No')
# Original solution
# 

n=int(eval(input()))
a=list(map(int,input().split()))
A=set(a[1:])
res=[-1]*n

dct={}
for e in a:
    dct[e]=dct.get(e,0)+1
tmp=a[0]
res[0]=tmp
dct[tmp]-=1

for i in range(1,n):
    tmp=res[0]^a[i]
    if  dct.get(tmp,0)>0:
        res[1]=a[i]
        res[-1]=res[0]^a[i]
        dct[res[1]]-=1
        dct[res[-1]]-=1
        break
else:
    print('No')
    exit()


for i in range(1,n-2):
    x=res[i]
    y=res[i-1]
    tmp=x^y
    if dct.get(tmp,0)>0:
        res[i+1]=tmp
        dct[tmp]-=1
    else:
        print('No')
        exit()

if res[-2]^res[-3]==res[-1]:
    print('Yes')
else:
    print('No')

# Optimized solution
# ACするけど不正解のやつ

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

print(('No' if ans else 'Yes'))