N,*as=$<.read.split.map(&:to_i)

a=m=as.pop
b=n=as.pop
h=Hash.new(0)
as.each { |a| h[a]+=1 }

as.length.times do
    if h[m^n] == 0
        puts 'No'
        exit
    end
    h[m^n] -= 1
    m,n = [n,m^n]
end

if m^n==a||m^n==b
    puts 'Yes'
else
    puts 'No'
end