import std.stdio, std.conv;
import std.algorithm, std.array, std.container, std.range, std.string;

import core.bitop;

void main()
{
    auto nab = reads!uint;
    immutable n = nab[0], a = nab[1], b = nab[2];
    if (cast(uint)(a ^ b).popcnt & 1)
        "YES\n%(%d %)".writefln((new size_t[1<<n]).solve(
                n, a, b));
    else
        "NO".writefln;
}

/// fill arr with sequence 0...d
size_t[] solve(
        size_t[] arr, in size_t n,
        in size_t start, in size_t end)
{
    debug stderr.writefln("solve(len=%d, n=%d, %d..%d)", arr.length, n, start, end);
    assert (arr.length == 1 << n);
    auto change = start ^ end;
    assert (change);
    if (arr.length == 2)
    {
        arr[0] = start;
        arr[1] = end;
        return arr;
    }

    size_t
        bigChange = 1 << (n-1),
        smallChange = 1 << (n-2);
    if (arr.length == 4)
        if ((start ^ end) & 1)
            bigChange.swap(smallChange);
    arr[0..$/2].solve(n-1, start, start ^ smallChange);
    arr[$/2..$].solve(n-1, start ^ smallChange ^ bigChange, end);
    debug foreach (elem; arr)
        stderr.writef("%0*b ", n, elem);
    debug stderr.writeln;
    return arr;
}

auto read(T)()
{
    return readln.chomp.to!T;
}
auto reads(T)()
{
    return readln.chomp.split.to!(T[]);
}
