#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<ll> solve(ll n,ll a,ll b){
    if(n==1)return {a,b};
    ll bit = 1 << (n-1);
    if( (a&bit) != (b&bit) ){
        auto v1 = solve(n-1,a,a^1);
        auto v2 = solve(n-1,(a^1)^bit,b);
        v1.insert(v1.end(),v2.begin(),v2.end());
        return v1;
    }
    else{
        auto v1 = solve(n-1,a,b);
        auto v2 = solve(n-1,a^bit,v1[1]^bit);
        v1.insert(v1.begin()+1,v2.begin(),v2.end());
        return v1;
    }
}
int main(){
    ios_base:: sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    ll n,a,b;cin>>n>>a>>b;
    if(__builtin_parity(a)==__builtin_parity(b))return cout<<"NO" , 0;
    cout<<"YES\n";
    auto ans = solve(n,a,b);
    for(auto &ele:ans)cout<<ele<<" ";
}


