#include <bits/stdc++.h>

using namespace std;

int lowbit(int x) {
  return x & -x;
}

int Bc(int x) {
  int r = 0;
  while (x) ++r, x -= lowbit(x);
  return r;
}

void Solve(int a, int b, int u, int ext) {
  if (a == b) {
    assert(!u);
    cout << (a | ext) << ' ';
    return;
  }
  assert(Bc(a ^ b) & 1);
  int xo = a ^ b;
  int y = lowbit(xo);
  u ^= y;
  if (a & y) {
    int c = a ^ y ^ lowbit(u);
    Solve(a ^ y, c, u, ext | y);
    Solve(c, b, u, ext);
  } else {
    int c = a ^ lowbit(u);
    Solve(a, c, u, ext);
    Solve(c, b ^ y, u, ext | y);
  }
}

int main() {
  int n, a, b;
  cin >> n >> a >> b;
  if (~Bc(a ^ b) & 1) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  Solve(a, b, (1 << n) - 1, 0);
  cout << endl;
  
  return 0;
}