#!/usr/bin/env python

import sys


def is_odd(x):
    return x%2==1

n= int(sys.stdin.readline())
ai  = [ int(x) for x in sys.stdin.readline().split() ]
#
ans= "No"
even= list(filter(lambda i:i % 2 ==0, ai))
odd = len(list(filter(lambda i:i % 2 ==1, ai)))
f= ai.index(max(even))
ll = len(bin(ai[f]))-2
second= []
for i in range(n):
    if i==f: continue
    a= ai[i]
    if len(bin(a))-2!=ll: continue
    if odd:
        if a%2==1: second.append(i)
    else:
        if a%2==0: second.append(i)
#
for s in second:
    tmp= [f,s]
    for i in range(2,n):
        nn = ai[tmp[-1]] ^ ai[tmp[-2]]
        i= 0
        while True:
            try:
                i= ai.index(nn,i)
                if i in tmp: i+=1
                else: break
            except:
                i= -1
                break
        if i==-1: break
        if nn in ai and not i in tmp:
            tmp.append(i)
        else:
            break
    #
    if len(tmp)==n:
        x,y,z,w = ai[tmp[-2]],ai[tmp[-1]],ai[tmp[0]],ai[tmp[1]]
        if x==y^z and y==z^w:
            ans="Yes"
            break
#
print( ans )
