#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   FOR(i,0,n)
#define pb emplace_back
typedef long long ll;
typedef pair<int,int> pint;

int n,a,b;
vector<int> ret;
void dfs(int l,int r,int mask){
    if((mask&(mask-1))==0){
        ret.pb(l);
        ret.pb(r);
        return;
    }
    int x=l^r;
    int tb=x&-x,tc=mask^tb;
    int td=tc&-tc;
    dfs(l,l^td,tc);
    dfs(l^tb^td,r,tc);
}
int main(){
    cin>>n>>a>>b;
    if(__builtin_popcount(a)%2==__builtin_popcount(b)%2){
        cout<<"NO"<<endl;
        return 0;
    }
    dfs(a,b,(1<<n)-1);
    cout<<"YES"<<endl;
    rep(i,ret.size()){
        cout<<ret[i]<<" ";
    }
    cout<<endl;
    return 0;
}
