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

enum inf3 = 1_001_001_001;
enum inf6 = 1_001_001_001_001_001_001L;
enum mod = 1_000_000_007L;


void main() {
    int n, a, b;
    scan(n, a, b);

    if (popcnt(a ^ b) % 2 == 0) {
        writeln("NO");
        return;
    }

    auto ans = solve(n, a, b);

    writeln("YES");
    writefln("%(%s %)", ans);
}

int[] solve(int n, int a, int b) {
    if (n == 1) {
        return a ? [1, 0] : [0, 1];
    }

    int dif = -1;
    int bs;

    foreach (i ; 0 .. n) {
        if (gb(a, i) ^ gb(b, i)) {
            dif = i;
            bs = gb(a, i);
            break;
        }
    }

    int ap = removeBit(a, dif);
    int bp = removeBit(b, dif);
    int c = ap ^ 1;
    auto mae = solve(n - 1, ap, c).map!(x => insertBit(x, dif, bs)).array;
    auto ato = solve(n - 1, c, bp).map!(x=> insertBit(x, dif, bs ^ 1)).array;
    return mae ~ ato;
}

int gb(int x, int i) {
    return (x >> i) & 1;
}

// x から i 番目のbitを抜く
int removeBit(int x, int i) {
    // ex. removeBit(10110101, 8, 3) = 01011101
    int u = (x >> (i + 1)) << i; // u = 01011000
    int v = x & ((1 << i) - 1);  // v = 00000101
    return u | v; // u | v = 01011101
}

// x の i 番目に状態bのbitを挿入する
int insertBit(int x, int i, int b) {
    // ex. insertBit(01011101, 3, 1) = 10111101
    int u = (x >> i) << (i + 1); // u = 10110000
    int v = x & ((1 << i) - 1);  // v = 00000101
    return u | v | (b << i);     // u | v | (b << i) = 10111101
}























int[][] readGraph(int n, int m, bool isUndirected = true, bool is1indexed = true) {
    auto adj = new int[][](n, 0);

    foreach (i; 0 .. m) {
        int u, v;
        scan(u, v);
        if (is1indexed) {
            u--, v--;
        }
        adj[u] ~= v;
        if (isUndirected) {
            adj[v] ~= u;
        }
    }

    return adj;
}

alias Edge = Tuple!(int, "to", int, "cost");

Edge[][] readWeightedGraph(int n, int m, bool isUndirected = true, bool is1indexed = true) {
    auto adj = new Edge[][](n, 0);

    foreach (i; 0 .. m) {
        int u, v, c;
        scan(u, v, c);
        if (is1indexed) {
            u--, v--;
        }
        adj[u] ~= Edge(v, c);
        if (isUndirected) {
            adj[v] ~= Edge(u, c);
        }
    }

    return adj;
}

void yes(bool b) {
    writeln(b ? "Yes" : "No");
}

void YES(bool b) {
    writeln(b ? "YES" : "NO");
}

T[] readArr(T)() {
    return readln.split.to!(T[]);
}

T[] readArrByLines(T)(int n) {
    return iota(n).map!(i => readln.chomp.to!T).array;
}

void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.algorithm : splitter;
    import std.conv : to;
    import std.range.primitives;

    auto line = readln().splitter();
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}

void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}

bool chmin(T, U...)(ref T x, U args) {
    bool isChanged;

    foreach (arg; args) {
        if (x > arg) {
            x = arg;
            isChanged = true;
        }
    }

    return isChanged;
}

bool chmax(T, U...)(ref T x, U args) {
    bool isChanged;

    foreach (arg; args) {
        if (x < arg) {
            x = arg;
            isChanged = true;
        }
    }

    return isChanged;
}


Measured memory_bytes: 6012