#include <iostream>
#include <map>
#include <set>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <fstream>
#include <bitset>
#include <queue>
#include <stack>
#include <deque>
#include <complex>
#include <iomanip>
#include <stdio.h>
#include <string.h>
#include <random>
#include <functional>

using std::cin;
using std::cout;
using std::cerr;
using std::endl;

using std::map;
using std::set;
using std::bitset;
using std::vector;
using std::string;
using std::multimap;
using std::multiset;
using std::deque;
using std::queue;
using std::stack;
using std::pair;
using std::iterator;

using std::sort;
using std::stable_sort;
using std::reverse;
using std::max_element;
using std::min_element;
using std::unique;
using std::ios_base;
using std::swap;
using std::fill;

using std::setprecision;
using std::fixed;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef string S;

ll min(ll a, ll b) {return a < b ? a : b;}
ll min(int a, ll b) {return a < b ? a : b;}
ll min(ll a, int b) {return a < b ? a : b;}
ll min(int a, int b) {return a < b ? a : b;}

ll max(ll a, ll b) {return a > b ? a : b;}
ll max(int a, ll b) {return a > b ? a : b;}
ll max(ll a, int b) {return a > b ? a : b;}
ll max(int a, int b) {return a > b ? a : b;}

namespace MySpace{

};

#define F(i, n) for (int (i) = 0; (i) != (n); (i)++)
#define fi first
#define se second
#define re return
#define all(x) (x).begin(), (x).end()
//#define int long long

int dp[5000][5000];
int cnt[5000];
int n, a, b;
vector<int> cycles[20];
vector<int> A, B;

void swap_bytes(int& num, int a, int b)
{
    int x = num;
    x &= (1 << 30) - 1 - (1 << a);
    x &= (1 << 30) - 1 - (1 << b);
    x |= (1 << a) * (((1 << b) & num) > 0);
    x |= (1 << b) * (((1 << a) & num) > 0);
    num = x;
}

signed main()
{
    ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    cin >> n >> a >> b;
    if (__builtin_popcount(a ^ b) % 2 == 0)
    {
        cout << "NO";
        return 0;
    }
    cout << "YES\n";
    cycles[0] = {0};
    for (int i = 1; i <= 16; i++)
    {
        for (int j = 0; j < cycles[i - 1].size(); j++) cycles[i].push_back(cycles[i - 1][j]);
        for (int j = cycles[i - 1].size() - 1; j >= 0; j--) cycles[i].push_back((1 << (i - 1)) + cycles[i - 1][j]);
    }
    int bi;
    for (int i = 0; i < n; i++)
    {
        if ((a & (1 << i)) != (b & (1 << i)))
        {
            bi = i;
        }
    }
    int sa = a, sb = b;
    b = b ^ a;
    A = cycles[n - 1];
    B = cycles[n - 1];
    for (int i = 0; i < B.size(); i++) B[i] = B[i] + (1 << (n - 1));

    for (int i = 0; i < A.size(); i++) swap_bytes(A[i], n - 1, bi);
    for (int i = 0; i < B.size(); i++) swap_bytes(B[i], n - 1, bi);
    //swap_bytes(b, n - 1, bi);

    vector<int> ans;
    for (int i = 0; i < (1 << (n - 1)); i += 2)
    {
        if (B[i] == b)
        {
            for (int j = i; j < A.size(); j++) ans.push_back(A[j]);
            for (int j = B.size() - 1; j >= i; j--) ans.push_back(B[j]);
            break;
        }
        else
        {
            ans.push_back(A[i]);
            ans.push_back(B[i]);
            ans.push_back(B[i + 1]);
            ans.push_back(A[i + 1]);
        }
    }
    for (int i = 0; i < ans.size(); i++)
    {
        //swap_bytes(ans[i], n - 1, bi);
        ans[i] ^= a;
        cout << ans[i] << " ";
    }
}


Measured memory_bytes: 2744