n = int(input())
als = list(map(int,input().split()))
ans = 'No'
sett = n//3
if n%3 == 0:
    for i in range(1,len(als)):
        if als.count(als[0]) == sett and als.count(als[i]) == sett and als.count(als[0]^als[i]) == sett:
            ans = 'Yes'
print(ans)