#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;
int N, A, B;
int beki[18];
set<int> same;
set<int> different;
vector<int> swap_first[20];
vector<int> ans;
set<int> already;

void verify(int index) {
    for(int i = 0; i < swap_first[index - 1].size(); i++) {
        //cerr << index << " " << i << " " << swap_first[index-1][i] << endl;
        swap_first[index].push_back(swap_first[index-1][i]*2);
    }
    for(int i = swap_first[index-1].size() - 1; i >= 0; i--) {
        //cerr << index << " " << i << " " << swap_first[index-1][i] << endl;
        swap_first[index].push_back(swap_first[index-1][i]*2+1);
        //swap_first[index].push_back(swap_first[index-i][i] * 2 + 1);
    }
}

int CHANGE(int from, int digit, int val) {
    int to = from % beki[digit];
    to += (from / beki[digit+1]) * beki[digit+1];
    to += val * beki[digit];
    //cerr << "CALLED CHANGE " << from << " " << digit << " "<< val << " " << to << endl;
    return to;
}

void query(int start, int diff, int digit, int val) {
    //cerr << "CALLED query " << start << " " << diff << " " << digit << " " << val << endl;
    int start_copy = start / beki[digit+1];
    start = start % beki[digit];
    start += start_copy * beki[digit];
    if(digit < diff) diff--;
    for(int i = 0; i < swap_first[N-2].size(); i++) {
        int copied = swap_first[N-2][i];
        int val_zero = copied & 1;
        int val_diff = (copied >> diff) & 1;
        copied = CHANGE(copied, 0, val_diff);
        copied = CHANGE(copied, diff, val_zero);
        int now = copied ^ start;
        now = (now % beki[digit]) + (now / beki[digit]) * beki[digit+1];
        now += beki[digit] * val;
        if(already.find(now) == already.end()) {
            ans.push_back(now);
            already.insert(now);
        }
        //cerr << " a " << now << endl;
    }
    //cout << ans.back() << endl;
}

int main() {
    //cout.precision(10);
    cin.tie(0);
    ios::sync_with_stdio(false);
    beki[0] = 1;
    for(int i = 1; i <= 17; i++) beki[i] = beki[i-1] * 2;
    cin >> N >> A >> B;
    swap_first[0] = {0, 1};
    for(int i = 1; i <= 17; i++) {
        //cerr << i << endl;
        verify(i);
        //cerr << swap_first[i].size() << endl;
    }
    /*
    for(int i = 0; i < swap_first[4].size(); i++) {
        cout << swap_first[4][i] << endl;
    }
    */
    int C = A^B;
    int num = 0;
    for(int i = 0; i < N; i++) {
        if((C >> i) & 1) {
            num++;
            different.insert(i);
        } else {
            same.insert(i);
        }
    }
    for(auto itr = same.begin(); itr != same.end(); itr++) {
        //cout << *itr << endl;
    }
    //cout << "DIFFERENT" << endl;
    for(auto itr = different.begin(); itr != different.end(); itr++) {
        //cout << *itr << endl;
    }
    if(num % 2 == 0) {
        cout << "NO" << endl;
        return 0;
    }
    //query(0, 2, 1, 1);
    int NEXT = A;
    while(same.size() + different.size() >= 2) {
        auto itr = different.begin();
        int constant = *itr;
        different.erase(itr);
        int now_digit;
        if(!same.empty()) {
            auto itr = same.begin();
            now_digit = *itr;
            same.erase(itr);
            different.insert(*itr);
        } else {
            auto itr = different.begin();
            now_digit = *itr;
            different.erase(itr);
            same.insert(*itr);
        }
        int val = (A >> constant) & 1;
        int val2 = (A >> now_digit) & 1;
        //query(A, now_digit, constant, val);
        query(A, now_digit, constant, val);
        A = CHANGE(A, constant, 1 - val);
        A = CHANGE(A, now_digit, 1 - val2);
    }
    for(int i = 0; i <= beki[N]; i++) {
        if(i == B) continue;
        if(already.find(i) == already.end()) {
            ans.push_back(i);
            break;
        }
    }
    ans.push_back(B);
    cout << "YES" << endl;
    for(int i = 0; i < ans.size(); i++) {
        cout << ans[i] << " ";
    }
    cout << endl;
    return 0;
}


Measured memory_bytes: 9844