#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>


using namespace std;
typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;

#define REP(i,n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i,a,b) for(int i = (a); i < (int)(b); ++i)
#define ALL(c) (c).begin(), (c).end()
#define SIZE(v) ((int)v.size())

#define pb push_back
#define mp make_pair
#define mt make_tuple


const int BIT_MAX = 17;

bool nth_bit_differs(int a, int b, int n) {
    return (a & (1 << n)) != (b & (1 << n));
}

void insert_bit(vector<int>& arr, int idx, int num) {
    int mul = 1;
    while (idx > 0) {
        mul *= 2;
        --idx;
    }
    for(auto& e: arr) {
        e = ((e / mul) * mul * 2) + (num * mul) + (e % mul);
    }
}

vector<int> solve(int from, int to, int N) {
    if (N == 1) {
        vector<int> ret{from, to};
        return ret;
    } else {

        int n = -1;
        REP(n_, N) {
            if (nth_bit_differs(from, to, n_)) {
                n = n_;
            }
        }
        //// 全部違うビットの場合適当
        //if (n == -1) {
        //    n = 0;
        //}


        int new_from = 0;
        int new_to = 0;
        int cnt = 0;
        REP(n2, N) {
            if (n != n2) {
                //new_from *= 2;
                //new_to *= 2;
                //new_from += (from & (1 << n2)) > 0;
                //new_to += (to & (1 << n2)) > 0;

                new_from += (1 << cnt) * ((from & (1 << n2)) > 0);
                new_to += (1 << cnt) * ((to & (1 << n2)) > 0);

                ++cnt;
            }
        }
        REP(n2, N) {
            int tmp = new_from;
            tmp ^= (1 << n2);
            if (tmp != new_to) {
                auto ret1 = solve(new_from, tmp, N - 1);
                auto ret2 = solve(tmp, new_to, N - 1);
                insert_bit(ret1, n, (from & (1 << n)) > 0  );
                insert_bit(ret2, n, (to & (1 << n)) > 0 );

                for(auto e: ret2) ret1.push_back(e);
                return ret1;
            }
        }

    }
}


// // from = A, to = Bで経路がA, v1, v2, ..., vn, Bのとき
// // [v1, v2, ..., vn]を返す
// vector<int> func(int from, int to, vector<int> &used_bit) {
//     if (from == to) return vector<int>();
//     REP(n, BIT_MAX) {
//         if (nth_bit_differs(from, to, n)) {
//             bool ok;
//             auto tour = make_tour(from, to, n, used_bit, ok);
//             if (ok) {
//                 auto new_used_bit = used_bit;
//                 new_used_bit[n] = 1;
//                 auto tour2 = func(tour.back(), to, new_used_bit);
                
//             }
//         }
//     }
// }

void print_vec(vector<int> vec) {
    auto size = SIZE(vec);
    REP(n, size) {
        if (n == 0) cout << vec[n];
        else cout << " " << vec[n];
    }
    cout << endl;
}

bool check(vector<int>& ans, int from, int to, int N) {
    auto size = SIZE(ans);
    REP(i, size - 1) {
        int n1 = ans[i];
        int n2 = ans[i + 1];
        int diff = 0;
        REP(n, N) {
            diff += (n1 & (1 << n)) != (n2 & (1 << n));
        }
        if (diff != 1) return false;
    }
    if (ans[0] != from) return false;
    if (ans.back() != to) return false;

    return true;
}

int main(void)
{
    cin.sync_with_stdio(false);

    //print_vec(solve(0, 1, 1));
    //print_vec(solve(1, 0, 1));
    //print_vec(solve(0, 1, 2));
    //print_vec(solve(1, 0, 2));
    //print_vec(solve(0, 2, 2));
    //print_vec(solve(2, 0, 2));
    //print_vec(solve(1, 3, 2));
    //print_vec(solve(3, 1, 2));
    //print_vec(solve(2, 3, 2));
    //print_vec(solve(3, 2, 2));
    //print_vec(solve(0, 1, 3));
    
    //print_vec(solve(0, 2, 3));0
    //print_vec(solve(0, 7, 4));

    //auto ans2 = solve(1, 4, 2);
    //auto res2 = check(ans2, 0, 7, 3);

    //// 途中まで0スタートの全通りを確かめる
    //FOR(N, 2, 10) {
    //    FOR(to, 1, (1 << N)) {
    //        int differ = 0;
    //        int A = 0;
    //        int B = to;
    //        REP(n, N) {
    //            differ += (A & (1 << n)) != (B & (1 << n));
    //        }
    //        if (differ % 2 == 0) {
    //            continue;
    //        }

    //        auto ans = solve(0, to, N);
    //        auto res = check(ans, 0, to, N);
    //        if (!res) {
    //            cout << "error!" << endl;
    //        }

    //    }
    //}


    //auto ans2 = solve(0, 7, 3);
    //auto res2 = check(ans2, 0, 7, 3);

    //auto ans = solve(0, (1 << 17) - 1, 17);
    //auto res = check(ans, 0, 1, 17);




    ll N, A, B;
    cin >> N >> A >> B;

    int differ = 0;
    REP(n, N) {
        differ += (A & (1 << n)) != (B & (1 << n));
    }
    if (differ % 2 == 0) {
        cout << "NO" << endl;
    } else {
        cout << "YES" << endl;
        print_vec(solve(A, B, N));
    }

    return 0;
}


Measured memory_bytes: 1648