n = gets.not_nil!.to_i
a = gets.not_nil!.split.map do |char| char.to_i end
a = a.sort

max_index = n - 1
ans = "Yes"
n.times do |i|
    if i == max_index - 1
        if a[max_index-2]^a[max_index] != a[max_index-1]
            ans = "No"
            break
        end
    end
    
    if i == max_index
        if a[max_index]^a[1] != a[0]
            ans = "No"
            break
        end
    end
    
    if i <  max_index - 1
         if a[i]^a[i+2] != a[i+1]
            ans =  "No"
            break
        end
   end
end

puts ans
        

     