import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric;

ulong to_g(ulong n)
{
    return n^(n>>1);
}

ulong from_g(ulong n)
{
    n = n^(n>>32);
    n = n^(n>>16);
    n = n^(n>>8);
    n = n^(n>>4);
    n = n^(n>>2);
    n = n^(n>>1);
    return n;
}

bool diff_one(ulong a, ulong b) {
    auto x = a^b;
    return x == 1L<<32 || x == 1L<<16 || x == 1L<<8 || x == 1L<<4 || x == 1L<<2 || x == 1L<<1 || x == 1L;
}

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

    auto a = A;
    auto b = B;
    if (from_g(a) > from_g(b)) {
        auto t = a;
        a = b;
        b = t;
    }

    ulong[] as, bs, cs;
    foreach_reverse(i; 0..from_g(a)+1) {
        as ~= to_g(i);
    }
    foreach (i; from_g(b)..2^^N) {
        bs ~= to_g(i);
    }
    foreach (i; from_g(a)+1..from_g(b)) {
        cs ~= to_g(i);
    }

    if (cs.empty) {
        writeln("Yes");
        ulong[] rs;
        foreach (x; as) {
            rs ~= from_g(x);
        }
        foreach (x; bs) {
            rs ~= from_g(x);
        }
        writeln(rs.to!(string[]).join(" "));
        return;
    }

    int i = -1;
    auto c = cs[0], d = cs[$-1];
    foreach (j, x; as[0..$-1]) {
        if (diff_one(x, c) && diff_one(as[j+1], d)) {
            i = j.to!int;
            break;
        }
        if (diff_one(x, d) && diff_one(as[j+1], c)) {
            i = j.to!int;
            cs = cs.reverse.array;
            break;
        }
    }
    if (i != -1) {
        writeln("Yes");
        ulong[] rs;
        foreach (j, x; as) {
            rs ~= from_g(x);
            if (j == i) {
                foreach (y; cs) rs ~= from_g(y);
            }
        }
        foreach (x; bs) {
            rs ~= from_g(x);
        }
        writeln(rs.to!(string[]).join(" "));
        return;
    }

    foreach (j, x; bs[0..$-1]) {
        if (diff_one(x, c) && diff_one(bs[j+1], d)) {
            i = j.to!int;
            break;
        }
        if (diff_one(x, d) && diff_one(bs[j+1], c)) {
            i = j.to!int;
            cs = cs.reverse.array;
            break;
        }
    }
    if (i != -1) {
        writeln("Yes");
        ulong[] rs;
        foreach (x; as) {
            rs ~= from_g(x);
        }
        foreach (j, x; bs) {
            rs ~= from_g(x);
            if (j == i) {
                foreach (y; cs) rs ~= from_g(y);
            }
        }
        writeln(rs.to!(string[]).join(" "));
        return;
    }

    writeln("No");
}