N = int(input())
A = list(map(int,input().split()))
first = A[-1]
dic = {}
dp = {}
for a in A[:-1]:
    if a in dic:
        dic[a] += 1
    else:
        dic[a] = 1
import sys
sys.setrecursionlimit(10**5)
def DP(count,pre,num,f,s,dic):
    temp = pre ^ num
    if (pre,num) in dp:
        return dp
    if count == N - 3:
        if dic[temp] == s:
            return True
        else:
            return False
        
    if temp in dic:
        if dic[temp] >= 1:
            dic[temp] -= 1
            dp[(pre,num)] = DP(count + 1,num,dic[temp],f,s,dic)
            return dp[(pre,num)]
def main():
    flag = False
    for a in A[:-1]:
        if first ^ a in dic:
            if dic[first ^ a] >= 2:
                tdic = dic.copy()
                flag = DP(0,a,a ^ first,first,a,tdic) or flag
                if flag:
                    print('Yes')
                    return
    print('No')
    return
if N == 3:
    if A[0] ^ A[1] == A[2]:
        print('Yes')
else:
    main()
