Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define SZ(x) ((int)(x).size())
#define debug(x) cerr << #x << ": " << x << '\n'
#define INF 999999999
typedef long long int Int;
typedef pair<int,int> P;
using ll = long long;
using VI = vector<int>;

signed main(){

ios::sync_with_stdio(false);
cin.tie(nullptr);
    int n,x;cin >> n >> x;
    int vec[2*n-1];
    iota(vec.begin(),vec.end(),1);
    int count;
    do{ 
        //for(auto &i:vec) cout << i << " ";
        //cout << endl;
        count=n;
        vector<int> a(n);
        a = vec;
        while(count!=1){
            for(int i=1;i<2*count-2;i++){
                int t[3];
                t[0] = a[i-1];
                t[1] = a[i];
                t[2] = a[i+1];
                sort(t.begin(),t.end());
                a[i-1]=t[1];
            }
            count--;
        }
        if(a[0]==x){
            cout << "Yes" << endl;
            for(auto &i:vec) cout << i << endl;
            return 0;
        }
    }while(next_permutation(vec.begin(),vec.end()));
    cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:14: error: request for member 'begin' in 'vec', which is of non-class type 'int [((n * 2) + -1)]'
   20 |     iota(vec.begin(),vec.end(),1);
      |              ^~~~~
a.cc:20:26: error: request for member 'end' in 'vec', which is of non-class type 'int [((n * 2) + -1)]'
   20 |     iota(vec.begin(),vec.end(),1);
      |                          ^~~
a.cc:27:13: error: no match for 'operator=' (operand types are 'std::vector<int>' and 'int [((n * 2) + -1)]')
   27 |         a = vec;
      |             ^~~
In file included from /usr/include/c++/14/vector:72,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/vector.tcc:210:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>]'
  210 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note:   no known conversion for argument 1 from 'int [((n * 2) + -1)]' to 'const std::vector<int>&'
  211 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66:
/usr/include/c++/14/bits/stl_vector.h:766:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = int; _Alloc = std::allocator<int>]'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:766:26: note:   no known conversion for argument 1 from 'int [((n * 2) + -1)]' to 'std::vector<int>&&'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:788:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = int; _Alloc = std::allocator<int>]'
  788 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:788:46: note:   no known conversion for argument 1 from 'int [((n * 2) + -1)]' to 'std::initializer_list<int>'
  788 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:34:24: error: request for member 'begin' in 't', which is of non-class type 'int [3]'
   34 |                 sort(t.begin(),t.end());
      |                        ^~~~~
a.cc:34:34: error: request for member 'end' in 't', which is of non-class type 'int [3]'
   34 |                 sort(t.begin(),t.end());
      |                                  ^~~
a.cc:44:33: error: request for member 'begin' in 'vec', which is of non-class type 'int [((n * 2) + -1)]'
   44 |     }while(next_permutation(vec.begin(),vec.end()));
      |                                 ^~~~~
a.cc:44:45: error: request for member 'end' in 'vec', which is of non-class type 'int [((n * 2) + -1)]'
   44 |     }while(next_permutation(vec.begin(),vec.end()));
      |                                             ^~~