import sys
readline = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
#mod = 998244353
INF = 10**18
eps = 10**-7
 
N = int(readline())
a = list(map(int,readline().split()))

a.sort()
 
if a[0] != a[1] ^ a[-1] or a[-1] != a[-2] ^ a[0]:
    print('No')
    exit()
 
ans = 'Yes'
 
for i in range(N-2):
    if a[i] ^ a[i+2] != a[i+1]:
        ans = 'No'
print(ans)