Language: C++

#define S second
#define P pair<long long,long long>
#define all(a) a.begin(),a.end()
#define INF 1000000000000000000
using namespace std;
signed main(void){
    int m,x;cin>>m>>x;
    int n=2*m+1;
    if(x==1||x==n)cout<<"No"<<endl;
    else if(n==3)cout<<"Yes"<<endl<<"1 2 3"<<endl;
    else{
        cout<<"Yes"<<endl;
        vector<int>Ans(n);
        Ans[m-1]=x+1;Ans[m]=x-1;Ans[m+1]=x;Ans[m+2]=x+2;
        int y=1;
        rep(i,n){
            if(i>=m-1&&i<=m+2)continue;
            if(y==x-1)y=x+3;
            Ans[i]=y;
            y++;
        }
        rep(i,n)cout<<Ans[i]<<' ';
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: 'cin' was not declared in this scope
    7 |     int m,x;cin>>m>>x;
      |             ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #define S second
a.cc:9:19: error: 'cout' was not declared in this scope
    9 |     if(x==1||x==n)cout<<"No"<<endl;
      |                   ^~~~
a.cc:9:19: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:9:31: error: 'endl' was not declared in this scope
    9 |     if(x==1||x==n)cout<<"No"<<endl;
      |                               ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #define S second
a.cc:10:18: error: 'cout' was not declared in this scope
   10 |     else if(n==3)cout<<"Yes"<<endl<<"1 2 3"<<endl;
      |                  ^~~~
a.cc:10:18: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:31: error: 'endl' was not declared in this scope
   10 |     else if(n==3)cout<<"Yes"<<endl<<"1 2 3"<<endl;
      |                               ^~~~
a.cc:10:31: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:12:9: error: 'cout' was not declared in this scope
   12 |         cout<<"Yes"<<endl;
      |         ^~~~
a.cc:12:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:12:22: error: 'endl' was not declared in this scope
   12 |         cout<<"Yes"<<endl;
      |                      ^~~~
a.cc:12:22: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:13:9: error: 'vector' was not declared in this scope
   13 |         vector<int>Ans(n);
      |         ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | #define S second
a.cc:13:16: error: expected primary-expression before 'int'
   13 |         vector<int>Ans(n);
      |                ^~~
a.cc:14:9: error: 'Ans' was not declared in this scope
   14 |         Ans[m-1]=x+1;Ans[m]=x-1;Ans[m+1]=x;Ans[m+2]=x+2;
      |         ^~~
a.cc:16:13: error: 'i' was not declared in this scope
   16 |         rep(i,n){
      |             ^
a.cc:16:9: error: 'rep' was not declared in this scope
   16 |         rep(i,n){
      |         ^~~