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

int n, a, b;
vector <int> res;

void Solve(int lvl, int a, int b, int got)
{
    for (int i = 0; i < n; i++) if ((a & 1 << i) != (b & 1 << i) && !(got & 1 << i)) {
        got |= 1 << i;
        int lst = a;
        for (int j = 1; j < 1 << lvl; j++) {
            int my = (j ^ (j >> 1));
            int pnt = 0;
            lst = a;
            for (int k = 0; k < n; k++) if (!(got & 1 << k)) {
                if ((my & 1 << pnt)) lst ^= (1 << k);
                pnt++;
            }
            res.push_back(lst);
        }
        a = lst;
        a ^= 1 << i;
        res.push_back(a);
        Solve(lvl - 1, a, b, got);
        return;
    }
}

int main()
{
    cin >> n >> a >> b;
    if (__builtin_popcount(a) % 2 == __builtin_popcount(b) % 2) {
        printf("NO\n");
        return 0;
    }
    printf("YES\n");
    res.push_back(a);
    Solve(n - 1, a, b, 0);
    for (int i = 0; i < res.size(); i++)
        printf("%d\n", res[i]);
    return 0;
}
