import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;

struct L {
  int[] l0, l1, l2, l3;
}

void fill (ref L l, int n, int a, int b) {
  foreach (k; 0 .. n) {
    immutable mask = 1 << k;
    if (a & mask) {
      if (b & mask) {
        l.l3 ~= k;
      } else {
        l.l2 ~= k;
      }
    } else {
      if (b & mask) {
        l.l1 ~= k;
      } else {
        l.l0 ~= k;
      }
    }
  }
}

void printAns (int[] x) {
  writeln ("YES");
  writefln ("%(%s %)", x);
}

void main() {
  int n, a, b;
  readf (" %d %d %d", &n, &a, &b);
  immutable m = 1 << n;
  auto c = uninitializedArray!(int[]) (m);
  foreach (i; 0 .. m) {
    c[i] = i ^ (i >> 1);
  }
  L l;
  fill (l, n, a, b);
  int[] check (int x, int y) {
    int[] l0, l1, l2, l3, m0, m1, m2, m3;
    L m;
    fill (m, n, x, y);
    if (m.l0.length != l.l0.length) return null;
    if (m.l1.length != l.l1.length) return null;
    if (m.l2.length != l.l2.length) return null;
    if (m.l3.length != l.l3.length) return null;
    auto t = new int[n];
    foreach (p; zip (l.l0, m.l0)) t[p[0]] = p[1]; 
    foreach (p; zip (l.l1, m.l1)) t[p[0]] = p[1]; 
    foreach (p; zip (l.l2, m.l2)) t[p[0]] = p[1]; 
    foreach (p; zip (l.l3, m.l3)) t[p[0]] = p[1]; 
    debug stderr.writeln ("t = ", t);
    return t;
  }
  int get (int[] t, int x) {
    int r;
    foreach (k; 0 .. n) {
      immutable mask = 1 << k;
      if (x & mask) r += 1 << t[k];
    }
    return r;
  }
  int[] ans;
  foreach (i; 0 .. m) {
    immutable j = (i + 1) % m;
    auto t = check (c[i], c[j]);
    if (t) {
      foreach (k; 0 .. m) {
        c[k] = get (t, c[k]);
      }
      if (!j) {
        ans ~= c;
      } else {
        ans ~= c[j .. $];
        ans ~= c[0 .. i+1];
      }
      ans.reverse ();
      printAns (ans);
      return;
    }
    t = check (c[j], c[i]); 
    if (t) {
      foreach (k; 0 .. m) {
        c[k] = get (t, c[k]);
      }
      if (!j) {
        ans ~= c;
      } else {
        ans ~= c[j .. $];
        ans ~= c[0 .. i+1];
      }
      printAns (ans);
      return;
    }
  }
  debug stderr.writeln (n, ' ', a, ' ', b);
  debug stderr.writeln (c);
  writeln ("NO");
}

