import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, core.stdc.string;

int diff(int a, int b) {
    int ret = 0;
    while (a > 0 || b > 0) {
        ret += (a & 1) ^ (b & 1);
        a >>= 1;
        b >>= 1;
    }
    return ret;
}

void main() {
    auto s = readln.split.map!(to!int);
    auto N = s[0];
    auto A = s[1];
    auto B = s[2];

    if (diff(A, B) % 2 == 0) {
        writeln("NO");
        return;
    }


    auto ans = new int[](1<<N);

    auto nodes = new int[][](N+1);
    auto cnt = new int[](N+1);

    foreach (i; 0..1<<N) {
        if (i != A && i != B) {
            nodes[i.popcnt] ~= i;
            cnt[i.popcnt] += 1;
        }
    }
    nodes[A.popcnt] = A ~ nodes[A.popcnt];
    nodes[B.popcnt] ~= B;

    bool swapped = false;

    if (A.popcnt > B.popcnt) {
        swapped = true;
        swap(A, B);
    }

    ans[0] = A.popcnt;
    ans[$-1] = B.popcnt;

    int p = 1;

    foreach_reverse (i; 0..A.popcnt.to!int) {
        ans[p++] = i;
        cnt[i] -= 1;
    }

    foreach (i; 0..B.popcnt) {
        cnt[i+1] -= 1;
        ans[p++] = i + 1;
        while (cnt[i] > 0) {
            cnt[i] -= 1;
            ans[p++] = i;
            cnt[i+1] -= 1;
            ans[p++] = i + 1;
        }
    }

    foreach (i; B.popcnt+1..N+1) {
        ans[p++] = i;
        cnt[i] -= 1;
    }

    foreach_reverse (i; B.popcnt..N+1) {
        if (cnt[i - 1] == 0) break;
        cnt[i-1] -= 1;
        ans[p++] = i - 1;
        while (cnt[i] > 0) {
            cnt[i] -= 1;
            ans[p++] = i;
            cnt[i-1] -= 1;
            ans[p++] = i - 1;
        }
    }

    if (swapped) {
        int[] new_ans = new int[](1<<N);
        foreach (i; 0..1<<N)
            new_ans[i] = ans[(1<<N)-i-1];
        ans = new_ans.dup;
    }

    auto pointer = new int[](1<<N);

    foreach (i; 0..1<<N) {
        ans[i] = nodes[ans[i]][pointer[ans[i]]++];
    }

    "YES".writeln;
    ans.map!(to!string).join(" ").writeln;
}
