#include <iostream>
#include <cmath>
#include<vector>
#include <algorithm>
#include <map>
#include<set>
#include<string>
#include <chrono>
#include <queue>

using namespace std;
#define pb push_back
#define mp make_pair

int maxn = ( 1 << 17 );
    vector<int> f( int a, int b, int n )
    {
 //       cout << a << " " << b << " " << n <<endl;
        int nexta, nextb,dosad=0;
        vector<int> sol;
       if( n==1 && a == 0 && b == 1  ){
            sol.clear();
            sol.pb( 0 );
            sol.pb( 1 );
            return sol;
       }
       else if( n == 1 && a==1 && b==0 ){
        sol.clear();
        sol.pb( 1 );
        sol.pb( 0 );
        return sol;
       }
        int idx,abit=0,bbit=0;
            for( int i = 0; ( 1 << i ) < maxn; i++ ){
                if(  ( a &( 1<< i ) ) != ( b&( 1<<i)    )  ) /// ako su razliciti idemo induktivno
                {
                    nexta=a-dosad;
                    nextb=b-dosad;
                    if( a&( 1<<i ) ) nexta-=( 1<<i );
                        if( b&( 1<<i ) ) nextb-=( 1<<i );
               //      abit = (( a& (  1<<i) ) == true);
                   //  bbit = (( b&( 1<<i ) ) == true);
                     if( a&( 1 << i  ) ) abit=1;
                     if( b&( 1<<i ) ) bbit=1;
                        nexta/=2;
                        nextb/=2;
                        nexta+=dosad;
                        nextb+=dosad;
                        idx = i;
                        break;
                }
                else if( ( a&(1<<i) ) ) dosad+=(1<<i);
            }
            vector<int> rec1 = f( nexta, ( nexta^1 ), n-1 );
            vector<int> rec2= f( ( nexta^1 ), nextb,n-1 );

            int sum=0;
            for( int i = 0;i < rec1.size() ;i++ ){           /// sad ubacujemo bit na idx poziciji
                for( int j = 0;j< idx;j++ ){
                        if( rec1[i] &( 1 << j ) ) sum+= ( 1<<j );
                }
         //       if( n == 2 ) cout << abit << " " << bbit << " nurko " <<endl;
                int num  = rec1[i] - sum;
                num*=2;
                num += ( abit << idx );
                num+=sum;
                sol.pb( num );
                sum=0;
            }
                for( int i = 0;i < rec2.size() ;i++ ){  /// sad ubacujemo bit na idx poziciji, u drugoj polovini
                               sum=0;
                for( int j = 0;j< idx;j++ ){
                        if( rec2[i] &( 1 << j ) ) sum+= ( 1<<j );
                }
                int num  = rec2[i] - sum;
                num*=2;
                num += ( bbit << idx );
                num+=sum;
                sol.pb( num );
            }
            return sol;
    }

int main()
{
       /* auto start = chrono::high_resolution_clock::now();
        /// OVDJE KOD KOJI SE RUNUJE
        auto finish = chrono::high_resolution_clock::now();
        chrono::duration<double> elapsed = finish - start;
        cout << "Elapsed time: " << elapsed.count() << " s\n";*/

      int n,a,b,cnta=0,cntb=0;
      cin >>n>>a>>b;
      for( int i = 0;i<n;i++ ){
        if( a&( 1<<i ) ) cnta++;
        if( b&( 1<<i ) ) cntb++;
      }
      if( ( cnta%2 ) == (  cntb%2 ) )
        {
            cout << "NO"<<endl;
            return 0;
        }
        else cout << "YES" <<endl;

      vector<int>res = f( a,b,n );

        for( int i = 0;i<res.size();i++ ){
            cout << res[i] << " ";
        }
        cout<<endl;

        return 0;
}
















Measured memory_bytes: 1628