#include<bits/stdc++.h>
using namespace std;

int main(){
    long N, A, B;
    cin >> N >> A >> B;

    auto P = 1L << N - 1;
    auto T = A ^ P ^ B;
    auto k = __builtin_popcountl(T);

    if(k & 1){
        puts("NO");
    }else{
        puts("YES");
        auto n = P * 2 - 1;
        vector<long> ans(n);
        for(long i = 0; i < n; ++i)ans[i] = i ^ i + 1 ^ (i ^ i + 1) / 2;

        vector<long> t;
        for(long i = 1; i <= P; i *= 2)if(T & i)t.push_back(i);

        auto s = t.size();
        for(long i = 0; i < s; i += 2){
            auto a = t[i], b = t[i + 1];
            for(long j = 0; j < n; ++j){
                if(ans[j] > b)break;
                if(ans[j] == a)ans[j] = b;
                else if(ans[j] == b)ans[j] = a;
            }
        }

        long a = A;
        cout << a << " ";
        for(const auto& i : ans)cout << (a ^= i) << " ";
        cout << endl;
    }

    return 0;
}