// IO library
#include <cstdio>
#include <iomanip>
#include <ios>
#include <iostream>

// algorithm library
#include <algorithm>
#include <cmath>
#include <numeric>
#include <random>

// contancer library
#include <bitset>
#include <deque>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>

using namespace std;

using ll = long long;
using ld = long double;

template <class T>
ostream& operator<<(ostream& os, vector<T> v) {
    os << "[";
    for (auto vv : v) os << vv << ",";
    return os << "]";
}

template <class T>
ostream& operator<<(ostream& os, set<T> v) {
    os << "{";
    for (auto vv : v) os << vv << ",";
    return os << "}";
}

template <class L, class R>
ostream& operator<<(ostream& os, pair<L, R> p) {
    return os << "(" << p.first << "," << p.second << ")";
}

template <class K, class T>
ostream& operator<<(ostream& os, map<K, T> v) {
    os << "{";
    for (auto vv : v) os << vv << ",";
    return os << "}";
}

template <class T>
ostream& operator<<(ostream& os, queue<T> q) {
    os << "[";
    while (!q.empty()) {
        os << q.front() << ",";
        q.pop();
    }
    return os << "]";
}

template <class T>
ostream& operator<<(ostream& os, priority_queue<T> q) {
    os << "{";
    while (!q.empty()) {
        os << q.top() << ",";
        q.pop();
    }
    return os << "}";
}

const ll MOD = 1000000007;
// const ll MOD = 998244353;
// const int INF = 1 << 25;
// const ll INF = 1LL << 50;
// const ld PI = acos(-1);
// const ld EPS = 1e-10;
// mt19937 mt(ll(time(0)));

template <class T>
vector<T> Vec(size_t l, T v) { return vector<T>(l, v); }

template <class T, class... Ts>
auto Vec(size_t l, Ts... ts) {
    return vector<decltype(Vec<T>(ts...))>(l, Vec<T>(ts...));
}

template <typename T>
inline T sq(T a) { return a * a; }

template <typename T>
inline T iceil(T n, T d) { return (n + d - 1) / d; }

template <typename T>
T gcd(T a, T b) {
    while (b > 0) {
        a %= b;
        swap(a, b);
    }
    return a;
}

template <typename T, typename U>
T ipow(T b, U n) {
    T ret = 1;
    while (n > 0) {
        if (n & 1) ret *= b;
        n >>= 1;
        b *= b;
    }
    return ret;
}

template <typename T, typename U>
T mpow(T b, U n) {
    T ret = 1;
    while (n > 0) {
        if (n & 1) ret = ret * b % MOD;
        n >>= 1;
        b = b * b % MOD;
    }
    return ret;
}

// wbit整数Aを左に回す
inline int lslide(int A, int w, int k) {
    return ((A & ((1 << (w - k)) - 1)) << k) + (A >> (w - k));
}

// wbit整数Aを右に回す
inline int rslide(int A, int w, int k) {
    return (A >> k) + ((A & ((1 << k) - 1)) << (w - k));
}

vector<int> dp[20];

// [0, 2^w)全体を回るようなサイクルを作る
vector<int> cycle(int w) {
    if (w == 0) return {0};
    if (!dp[w].empty()) return dp[w];

    vector<int> head = cycle(w - 1);
    vector<int> tail = head;
    reverse(tail.begin(), tail.end());
    for (auto& t : tail) t += (1 << (w - 1));
    copy(tail.begin(), tail.end(), back_inserter(head));
    return dp[w] = head;
}

vector<int> solve(int A, int B, int N) {
    if (N == 1) return {A, B};

    int k;
    for (k = 0; k < N; ++k) {
        if (((A >> (N - 1 - k)) & 1) != ((B >> (N - 1 - k)) & 1)) break;
    }
    A = lslide(A, N, k), B = lslide(B, N, k);

    vector<int> ch = cycle(N - 1);
    for (auto& c : ch) c ^= A;

    auto res = solve(ch.back() & ((1 << (N - 1)) - 1), B & ((1 << (N - 1)) - 1), N - 1);
    for (auto& c : res) c ^= B & (1 << (N - 1));
    copy(res.begin(), res.end(), back_inserter(ch));

    for (auto& a : ch) a = rslide(a, N, k);
    return ch;
}

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

    cerr << bitset<20>(A) << endl;
    cerr << bitset<20>(B) << endl;

    if (__builtin_popcount(A ^ B) % 2 == 0) {
        cout << "NO" << endl;
        return 0;
    }

    cout << "YES" << endl;
    auto ans = solve(A, B, N);
    for (auto& a : ans) {
        cout << a << " ";
    }
    cout << endl;
    set<int> s(ans.begin(), ans.end());
    if (s.size() != (1 << N)) terminate();
    return 0;
}


Measured memory_bytes: 8240