#include <bits/stdc++.h>
using namespace std;
int N, A, B;

void solve(int a, int b, int fix) {
    if(a == b) {
        if(a == A) printf("%d", a);
        else printf(" %d", a);
        return;
    }
    int c = a ^ b;
    for(int i = 0; i < N; ++i) {
        if(fix & (1 << i)) continue;
        if(c & (1 << i)) {
            int d = a;
            for(int j = 0; j < N; ++j) {
                if(i == j)continue;
                if(fix & (1 << j)) continue;
                d ^= (1 << j);
                break;
            }
            solve(a, d, fix ^ (1 << i)), solve(d ^ (1 << i), b, fix ^ (1 << i));
            break;
        }
    }
}

int main() {
    scanf("%d %d %d", &N, &A, &B);
    if(__builtin_popcount(A ^ B) % 2 == 0) puts("NO");
    else puts("YES"), solve(A, B, 0), puts("");
    return 0;
}