n = int(input())
a = [int(x) for x in input().split(' ')]
a.sort()

if((a[0] ^ a[n-2] == a[-1]) and (a[1] ^ a[-1] == a[0])) :
        for k in range(n-2) :
                if (a[k] ^ a[k+2] != a[k+1]) :
                        print('No')                        
                        break
        else :
                print('Yes')        
                
else :
        print('No')        
