N = int(input())
l = list(map(int,input().split(' ')))
dp = {}
k = True
for i in range(N):
    tmp = l[i]
    if tmp in dp:
        dp[tmp] +=1
    else:
        if len(dp)==3:
            k = False
            break
        else:
            dp[tmp] = 1

flag = False
if k:
    if len(dp)==3:
        num_l = []
        ans_l = []
        for key,val in dp.items():
            num_l.append(key)
            ans_l.append(val)
        if ans_l[0]==ans_l[1] and ans_l[0]==ans_l[2]:
            if num_l[0]^num_l[1]==num_l[2]:
                flag = True
if flag:
    print('Yes')
else:
    print('No')