# Your code here!

N,A,B=gets.split.map &:to_i
sA=A.to_s(2).rjust(N,"0")
sB=B.to_s(2).rjust(N,"0")
changes=(0...N).map{|i|i if sA[i]!=sB[i]}.compact
#p changes

if changes.size%2==0
    puts :NO
else
    puts :YES
    r=[[0],[1]]
    (1...N).each{|i|
        pow=2**i
        r=r+r.reverse.map{|k|k.map{|i|i}}
        #p r
        (0...(pow)).each{|j|
            r[j] << 0
        }
        (pow...(2*pow)).each{|j|
            r[j] << 1
        }
    }
    #r.each{|k|puts k.join" "}
    (changes.size/2).times{|k|
        i=2**N-1
        while 1
            all_one = true
            (0...(k+1)*2).each{|l|
                #p [i,l,r[i][l]]
                if r[i][l]!=1 then all_one=false;break end
            }
            #p [i,all_one]
            if all_one
                #i~2**Nを反転
                r[i,2**N-i]=r[i,2**N-i].reverse
                break
            end
            i -= 1
        end
    }
    #p r
    change=0;same=0;mp={}
    N.times{|k|
        if sA[k]==sB[k]
            mp[k]=[changes.size-1+same, sA[k]=="0"];same+=1
        else
            if change==0
                mp[k]=[N-1, sA[k]=="0"]
            else
                mp[k]=[change-1,sA[k]=="0"]
            end
            change+=1
        end
    }
    #p A.to_s(2), B.to_s(2), mp
    #r.each{|l|p l.join""}
    #p mp
    puts r.map{|l|
        N.times.map{|k|
            if mp[k][1]
                l[mp[k][0]]
            else
                1-l[mp[k][0]]
            end
        }.join("").to_i(2)
    }.join" "
end



