#!/usr/bin/env python

import sys

n= int(sys.stdin.readline())
ai  = []
even= []
odd = []
lmax= 0
for i,x in enumerate( sys.stdin.readline().split() ):
    a = int(x)
    ai.append(a)
    #
    if a%2==0: even.append(i)
    else: odd.append(i)
    #
    tmp= len(bin(a))-2
    if tmp>lmax: lmax= tmp
#
ne= len(even)
no= len(odd)
if no!=0 and no!=2*ne:
    print( "No" )
    exit()
#
first=[]
for e in even:
    ee = ai[e]
    if len(bin(ee))==lmax+2: first.append(ee)
#
if len(first)==0:
    print( "No" )
    exit()
#
second=[]
if no>0:
    for o in odd:
        oo = ai[o]
        if len(bin(oo))==lmax+2: second.append(oo)
else:
    for e in even:
        ee = ai[e]
        if len(bin(ee))==lmax+2: second.append(ee)
#
if len(second)==0:
    print( "No" )
    exit()
#
tc= []
for f in first:
    for s in second:
        if f==s: continue
        tc.append( (f,s) )
#
def search(arr):
    global ai, even, odd
    if len(arr)==n and arr[-1]==arr[0]^arr[-2] and arr[0]==arr[-1]^arr[1]:
        return True
    #
    if no>0 and len(arr)%3!=0: ref= odd
    else: ref= even
    #
    for i in ref:
        if i in arr: continue
        if ai[i] ^ arr[-2] == arr[-1]:
            ac = arr.copy()
            ac.append( ai[i] )
            tf= search(ac)
            if tf: return tf
    #
    return False

for f,s in tc:
    tmp= [f,s]
    tf = search(tmp)
    if tf:break
#
if tf: print("Yes")
else: print("No")
