Language: C++

int n, x;
 
int main() {
	cin >> n >> x;
	if (n == 2) {
		if (x == 2) {
			cout << "Yes" << endl;
			rep(i, 3) {
				cout << i + 1 << endl;
			}
		}
		else cout << "No" << endl;
	}
	else {
		if (x == 2 * n - 1 || x == 1)cout << "No" << endl;
		else {
			cout << "Yes" << endl;
			vector<int> vi;
			rep(i, 2 * n - 1) {
				vi.push_back(i + 1);
			}
			if (x + 2 <= 2 * n - 1) {
				rep(i, 2 * n - 1) {
					if (i + 1 == n - 1)cout << x - 1 << endl;
					else if (i + 1 == n)cout << x << endl;
					else if (i + 1 == n + 1)cout << x + 1 << endl;
					else if (i + 1 == n + 2)cout << x - 2 << endl;
					else if (i + 1 == x - 1)cout << n - 1 << endl;
					else if (i + 1 == x)cout << n << endl;
					else if (i + 1 == x + 1)cout << n + 1 << endl;
					else if (i + 1 == x - 2)cout << n + 2 << endl;
					else cout << vi[i] << endl;
				}
			}
			else {
				rep(i, 2 * n - 1) {
					if (i + 1 == n - 1)cout << x + 2 << endl;
					else if (i + 1 == n)cout << x - 1 << endl;
					else if (i + 1 == n + 1)cout << x << endl;
					else if (i + 1 == n + 2)cout << x + 1 << endl;
					else if (i + 1 == x + 2)cout << n - 1 << endl;
					else if (i + 1 == x - 1)cout << n << endl;
					else if (i + 1 == x)cout << n + 1 << endl;
					else if (i + 1 == x + 1)cout << n + 2 << endl;
					else cout << vi[i] << endl;
				}
			}
 
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope
    4 |         cin >> n >> x;
      |         ^~~
a.cc:7:25: error: 'cout' was not declared in this scope
    7 |                         cout << "Yes" << endl;
      |                         ^~~~
a.cc:7:42: error: 'endl' was not declared in this scope
    7 |                         cout << "Yes" << endl;
      |                                          ^~~~
a.cc:8:29: error: 'i' was not declared in this scope
    8 |                         rep(i, 3) {
      |                             ^
a.cc:8:25: error: 'rep' was not declared in this scope
    8 |                         rep(i, 3) {
      |                         ^~~
a.cc:12:22: error: 'cout' was not declared in this scope
   12 |                 else cout << "No" << endl;
      |                      ^~~~
a.cc:12:38: error: 'endl' was not declared in this scope
   12 |                 else cout << "No" << endl;
      |                                      ^~~~
a.cc:15:46: error: 'cout' was not declared in this scope
   15 |                 if (x == 2 * n - 1 || x == 1)cout << "No" << endl;
      |                                              ^~~~
a.cc:15:62: error: 'endl' was not declared in this scope
   15 |                 if (x == 2 * n - 1 || x == 1)cout << "No" << endl;
      |                                                              ^~~~
a.cc:17:25: error: 'cout' was not declared in this scope
   17 |                         cout << "Yes" << endl;
      |                         ^~~~
a.cc:17:42: error: 'endl' was not declared in this scope
   17 |                         cout << "Yes" << endl;
      |                                          ^~~~
a.cc:18:25: error: 'vector' was not declared in this scope
   18 |                         vector<int> vi;
      |                         ^~~~~~
a.cc:18:32: error: expected primary-expression before 'int'
   18 |                         vector<int> vi;
      |                                ^~~
a.cc:19:29: error: 'i' was not declared in this scope
   19 |                         rep(i, 2 * n - 1) {
      |                             ^
a.cc:19:25: error: 'rep' was not declared in this scope
   19 |                         rep(i, 2 * n - 1) {
      |                         ^~~