Problem:
 Score : 400 points    Problem Statement We have a pyramid with N steps, built with blocks.
The steps are numbered 1 through N from top to bottom.
For each 1≤i≤N , step i consists of 2i-1 blocks aligned horizontally.
The pyramid is built so that the blocks at the centers of the steps are aligned vertically.    A pyramid with N=4 steps   Snuke wrote a permutation of ( 1 , 2 , ... , 2N-1 ) into the blocks of step N .
Then, he wrote integers into all remaining blocks, under the following rule:   The integer written into a block b must be equal to the median of the three integers written into the three blocks directly under b , or to the lower left or lower right of b .     Writing integers into the blocks   Afterwards, he erased all integers written into the blocks.
Now, he only remembers that the integer written into the block of step 1 was x .  Construct a permutation of ( 1 , 2 , ... , 2N-1 ) that could have been written into the blocks of step N , or declare that Snuke's memory is incorrect and such a permutation does not exist.      Constraints  2≤N≤10^5  1≤x≤2N-1         Input The input is given from Standard Input in the following format:  N  x       Output If no permutation of ( 1 , 2 , ... , 2N-1 ) could have been written into the blocks of step N , print No .  Otherwise, print Yes in the first line, then print 2N-1 lines in addition.  The i -th of these 2N-1 lines should contain the i -th element of a possible permutation.        Sample Input 1 4 4      Sample Output 1 Yes
1
6
3
7
4
5
2  This case corresponds to the figure in the problem statement.       Sample Input 2 2 1      Sample Output 2 No  No matter what permutation was written into the blocks of step N , the integer written into the block of step 1 would be 2 .

Solution (Python):



import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n,x = LI()
if x == 1 or x == 2*n-1:
    print('No')
elif x - 1 == 1:
    print('Yes')
    if n == 2:
        print(1,2,3)
        quit()
    ans = [0]*(2*n-1)
    ans[(2*n-1)//2] = x
    ans[(2*n-1)//2-1] = x+2
    ans[(2*n-1)//2+1] = x-1
    tmp = 1
    for i in range(2*n-1):
        if tmp == x-1:
            tmp = x+1
        if tmp == x+2:
            tmp += 1
        if ans[i] == 0:
            ans[i] = tmp
            tmp += 1
    print(*ans)
else:
    print('Yes')
    ans = [0]*(2*n-1)
    ans[(2*n-1)//2] = x
    ans[(2*n-1)//2+1] = x+1
    ans[(2*n-1)//2-1] = x-2
    tmp = 1
    for i in range(2*n-1):
        if tmp == x-2:
            tmp = x-1
        elif tmp == x:
            tmp = x+2
        if ans[i] == 0:
            ans[i] = tmp
            tmp += 1
    print(*ans)

Solution (Python):
n,x = map(int,input().split())
if x == 1 or x == 2*n-1:
    print("No")
    exit()

print("Yes")
ans = [i for i in range(1,2*n)]
ans.remove(x-1)
ans.remove(x)
ans.remove(x+1)
for i in range(n-2):
    print(ans[i])
print(x-1)
print(x)
print(x+1)
for i in range(n-2):
    print(ans[n-2+i])

Solution (Python):
N, x = map(int, input().split())
if x == 1 or x == 2 * N - 1:
    print("No")
else:
    if x <= N:
        ans = list(range(1, x - 1) ) +  list(range(x + 2, N + 2)) + [x - 1, x, x + 1] + list(range(N + 2,  2 * N))
    else:
        ans = list(range(1, N  - 1)) + [x - 1, x, x + 1] + list(range(N - 1, x - 1)) + list(range(x + 2, 2 * N))
    print("Yes")
    for a in ans:
        print(a)

Solution (Python):

N,x = map(int,input().split())

if x == 1 or x == 2*N-1:
    print("No")
elif N == 2:
    print("Yes")
    print(1)
    print(2)
    print(3)
else:
    print("Yes")
    if x == 2:
        Key = [x+1,x,x-1,x+2]
    else:
        Key = [x-1,x,x+1,x-2]
    Unit = []
    for i in range(2*N-1):
        if (i+1) not in Key:
            Unit.append(i+1)
                
    for i in range(N-2):
        u = Unit.pop()
        print(u)
    for k in Key:
        print(k)
    for i in range(N-3):
        u = Unit.pop()
        print(u)

Solution (Python):
N,x = map(int,input().split())
if not(1 < x < N*2-1):
    print("No")
    exit()

print('Yes')
A = [i+1 for i in range(N*2-1)]
A[N-1],A[x-1] = A[x-1],A[N-1]
if A[N-1] < A[N-2]:
    A[N-2],A[0] = A[0],A[N-2]
if A[N-1] > A[N]:
    A[N],A[-1] = A[-1],A[N]
for i in A:
    print(i)

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

N,X = map(int,input().split())

if X in [1,2*N-1]:
    print('No')
    exit()

if N == 2:
    print('Yes')
    print(*[1,2,3],sep='\n')
    exit()

rest = set(range(1,2*N))
answer = [None] * (2*N-1)
center = N-1
if X <= 2*N-3:
    answer[center-2:center+2] = X+2,X-1,X,X+1
else:
    answer[center-2:center+2] = X-2,X+1,X,X-1
rest -= set(answer[center-2:center+2])
for i in range(2*N-1):
    if answer[i] is None:
        answer[i] = rest.pop()

print('Yes')
print(*answer,sep='\n')

Solution (Python):
import sys
import heapq
from operator import itemgetter
from collections import deque, defaultdict
from bisect import bisect_left, bisect_right
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

def sol():
    N, x = map(int, input().split())

    if x == 1 or x == 2 * N - 1:
        print('No')
    else:
        print('Yes')
        ans = [None] * (2 * N - 1)
        numList = list(range(1, 2 * N))

        for i in range(3):
            ans[N - 2 + i] = x - 1 + i
            numList[x - 2 + i] = None
        if x > N:
            ans[N + 1] = 1
            numList[0] = None
        elif x < N:
            ans[N - 3] = 2 * N - 1
            numList[2 * N - 2] = None

        numList = list(filter(lambda n: n != None, numList))
        now = 0
        for a in ans:
            if a == None:
                print(numList[now])
                now += 1
            else:
                print(a)



sol()

Solution (Python):

n, x = [ int(v) for v in input().split() ]



if x in [1,2*n-1]:
    print("No")
else:
    print("Yes")
    ans_list = [ None for i in range(2*n-1) ]
    num_list = [ i+1 for i in range(2*n-1) ]

    for i in range(3):
        ans_list[n-2+i] = x-1+i
        num_list[x-2+i] = None
    if x > n:
        ans_list[n+1] = 1
        num_list[0] = None
    elif x < n:
        ans_list[n-3] = 2*n-1
        num_list[2*n-2] = None
    
    num_list = [ i for i in num_list if i != None ]

    t = 0
    for i in ans_list:
        if i == None:
            print(num_list[t])
            t += 1
        else:
            print(i)

Solution (Python):
import bisect
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7

N, X = list(map(int, sys.stdin.readline().split()))


def pyramid(row):
    ret = [row]
    while len(row) >= 3:
        r = []
        for r1, r2, r3 in zip(row, row[1:], row[2:]):
            r.append(int(np.median([r1, r2, r3])))
        row = r
        ret.append(row)
    ret.reverse()
    return ret













if 1 < X < N * 2 - 1:
    row = list(range(1, N * 2))
    if X <= N:
        for i in range(N):
            row[i] = (i + X) % N + 1
    else:
        for i in range(N):
            row[i + N - 1] = (i + X) % N + N
    print('Yes')
    print(*row, sep='\n')
else:
    print('No')

Solution (Python):
import sys
n,x=map(int,input().split())
if x==1 or x==n*2-1:
  print('No')
  sys.exit()
print('Yes')
if n==2:
  for i in range(1,4):
    print(i)
  sys.exit()
if x==2:
  l=[x+1,x,x-1,x+2]
else:
  l=[x-1,x,x+1,x-2]
L=[]
for i in range(1,n*2):
  if i not in l:
    L.append(i)
for i in range(n-2):
  print(L[i])
for i in range(4):
  print(l[i])
for i in range(n-3):
  print(L[i+n-2])

Solution (Python):
n,x=map(int,input().split())
if x==1 or x==2*n-1:
    print("No")
else:
    print("Yes")
    if n==2:
        b=[1,2,3]
    else:
        if x==2:
            b=[i for i in range(2*n-1,n,-1)]+[i for i in range(1,n+1)]
        elif x==2*n-2:
            b=[i for i in range(n,2*n)]+[i for i in range(n-1,0,-1)]
        else:
            a=[i for i in range(1,2*n)]
            temp=[x+1,x-1,x,x+2,x-2]
            for t in temp:
                a.remove(t)
            b=a[:n-2]+temp+a[n-2:]
    for i in b:
        print(i)

Solution (Python):
def main():
    N, x = map(int, input().split())
    if 2 <= x < 2*N-1:
        print("Yes")
        ans = [0] * (N*2-1)
        for i in range(1, N):
            if i == x:
                ans[i*(-1)**i+N-1] = N
            else:
                ans[i*(-1)**i+N-1] = i
        for i in range(1, N):
            if N*2-i == x:
                ans[i*(-1)**(i+1)+N-1] = N
            else:
                ans[i*(-1)**(i+1)+N-1] = N*2-i
        ans[N-1] = x
        for i in range(0, N*2-1):
            print(ans[i])
    else:
        print("No")


if __name__ == "__main__":
    main()

Solution (Python):
N, x = map(int, input().split())
if x == 1 or x == 2 * N - 1:
    print('No')
    exit()
if N == 2:
    print('Yes')
    for i in [1, 2, 3]:
        print(i)
    exit()


ans = [0] * (2 * N - 1)
ans[N - 2], ans[N - 1], ans[N] = x - 1, x, x + 1
d = 1
for i in range(2 * N - 1):
    if i in [N - 2, N - 1, N]:
        continue
    if d == x - 1:
        d = x + 2
    ans[i] = d
    d += 1

print('Yes')
for i in ans:
    print(i)

Solution (Python):
N,x=list(map(int,input().split()))
if x==1 or x==2*N-1:
    print('No')
else:
    print('Yes')
    a=[]
    if N==2:
        a=[1,2,3]
    elif x==2:
        n=5
        for i in range(2*N-4):
            if i==N-2:
                a.append('\n'.join(map(str,[x+1,x,x-1,x+2])))
            else:
                a.append(n)
                n+=1
    else:
        n=5 if x==3 else 1
        for i in range(2*N-4):
            if i==N-2:
                a.append('\n'.join(map(str,[x-1,x,x+1,x-2])))
            else:
                a.append(n)
                n=x+2 if n==x-3 else n+1
    for i in range(len(a)):
        print(a[i])

Solution (Python):
N,x = map(int,input().split())
ans = (list(range(1,2*N))*2)[(x-N)%(2*N-1):(x-N)%(2*N-1)+2*N-1]
if x==1 or x==2*N-1:ans = []
if ans:
    print("Yes")
    print(*ans)
else: print("No")

Solution (Python):
from collections import deque

N,x = map(int,input().split())

if x <= 1 or x >= 2*N-1 :
    print("No")
else :
    print("Yes")
    
    q = deque([x])
    for i in range(1,N) :
        if x-i > 0 :
            q.appendleft(x-i)
        else :
            q.appendleft((2*N-1)+x-i)
    for i in range(1,N) :
        if x+i < 2*N :
            q.append(x+i)
        else :
            q.append(x+i-(2*N-1))
    
    for p in q :
        print(p)

Solution (Python):
import sys
stdin = sys.stdin

sys.setrecursionlimit(10 ** 7)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x) - 1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())


n, x = li()

if n == 2:
    if x == 2:
        print("Yes")
        for i in range(1, 4):
            print(i)

    else:
        print("No")

else:
    ans = [0]*(2*n - 1)
    rem = [i for i in range(1, 2*n)]

    if x == 1 or x == 2*n-1:
        print("No")

    else:
        print("Yes")
        if x == 2:
            ans[n - 2] = x+1
            ans[n - 1] = x
            ans[n] = x-1
            ans[n + 1] = x+2

            for i in range(x-1, x+3):
                rem.remove(i)

            for idx in range(2*n-1):
                if n-2 <= idx <= n+1:
                    continue

                ans[idx] = rem.pop()

        else:
            ans[n - 2] = x - 1
            ans[n - 1] = x
            ans[n] = x + 1
            ans[n + 1] = x - 2

            for i in range(x - 2, x + 2):
                rem.remove(i)

            for idx in range(2 * n - 1):
                if n - 2 <= idx <= n + 1:
                    continue

                ans[idx] = rem.pop()

        print("\n".join(map(str, ans)))

Solution (Python):
N,x = map(int,input().split())
if x in {1,2*N-1}:print("No")
else:
    print("Yes")
    if x>=N:
        ans = list(range(N,x))+list(range(x+1,2*N)) + [x] + list(range(1,N))
    else:
        ans = list(range(N+1,2*N)) + [x] + list(range(1,x)) + list(range(x+1,N+1))
    print("\n".join(map(str,ans)))

Solution (Python):
n,x=map(int,input().split())
if x==1 or x==2*n-1:
  print('No')
elif x==2:
  print('Yes')
  if n==2:
    print(x+1)
    print(x)
    print(x-1)
  else:
    ans=[]
    for i in range(1,2*n):
      if x-1<=i<=x+2:
        continue
      else:
        ans.append(i)
    cnt=0
    for i in range(1,2*n):
      if i==n-1:
        print(x+1)
      elif i==n:
        print(x)
      elif i==n+1:
        print(x-1)
      elif i==n+2:
        print(x+2)
      else:
        print(ans[cnt])
        cnt+=1
else:
  print('Yes')
  if n==2:
    print(x+1)
    print(x)
    print(x-1)
  else:
    ans=[]
    for i in range(1,2*n):
      if x-2<=i<=x+1:
        continue
      else:
        ans.append(i)
    cnt=0
    for i in range(1,2*n):
      if i==n-1:
        print(x-2)
      elif i==n:
        print(x)
      elif i==n+1:
        print(x+1)
      elif i==n+2:
        print(x-1)
      else:
        print(ans[cnt])
        cnt+=1

Solution (Python):
from collections import deque

N,x = list(map(int,input().split()))

if x==2*N-1 or x==1:
    print("No")
else:
    Q=deque()
    if x<=N:
        Q.append(x)
        Q.append(x-1)
        for i in range(2*N-1,0,-1):
            if i!=x and i!=x-1:
                if i%2==0:
                    Q.append(i)
                else:
                    Q.appendleft(i)
    else:
        Q.append(x)
        Q.append(x+1)
        for i in range(1,2*N):
            if i!=x and i!=x+1:
                if i%2==0:
                    Q.append(i)
                else:
                    Q.appendleft(i)

    print("Yes")

    while len(Q)>0:
        print(Q.pop())

Solution (Python):
N,x = map(int,input().split())
if x==1 or x==2*N-1:
    print("No")
else:
    print("Yes")
    l = [i for i in range(1,2*N)]
    l.remove(x-1)
    l.remove(x)
    l.remove(x+1)
    for i in range(N-2):
        print(l[i])
    print(x-1)
    print(x)
    print(x+1)
    for i in range(N-2):
        print(l[N-2+i])

Solution (Python):
n,x=map(int,input().split())
if x==1 or x==2*n-1:
  print("No")
else:
  print("Yes")
  if x>n:
    for i in range(1,x-n+1):
      print(i)
    for i in range(3*n-x-1):
      print(2*n-1-i)
  elif x==n:
    for i in range(1,2*n):
      print(i)
  else:
    for i in range(n-x):
      print(2*n-1-i)
    for i in range(n+x-1):
      print(i+1)

Solution (Python):
n, x = [int(item) for item in input().split()]
if x == 1 or x == 2*n-1:
    print("No")
    exit()

if n == 2:
    print("Yes")
    print("1 2 3")
    exit()

ans = [0] * (2*n - 1)
used = [0] * (2*n - 1)
if x >= n:
    ans[n-1] = 2*n-1
    used[2*n-1-1] = 1
    ans[n] = x
    used[x-1] = 1
    ans[n+1] = x-1
    used[x-2] = 1
    ans[n-2] = x-2
    used[x-3] = 1
else:
    ans[n-1] = 1 
    used[0] = 1
    ans[n] = x
    used[x-1] = 1
    ans[n+1] = x+1
    used[x] = 1
    ans[n-2] = x+2
    used[x+1] = 1
it = 0
for i in range(2*n-1):
    if ans[i] == 0:
        while(used[it] != 0):
            it += 1
        ans[i] = it+1
        it += 1
print("Yes")
print(" ".join([str(item) for item in ans]))

Solution (Python):
N, x = map(int,input().split())
if x == 1 or x == 2*N-1:
    print("No")
    exit(0)
if N == 2:
    print("Yes")
    print(*[1,2,3], sep="\n")
    exit(0)

A = [0 for k in range(2*N-1)]
A[N-2], A[N-1], A[N] = x-1, x, x+1
t = 1
for k in range(N-2):
    while x-1 <= t <= x+1:
        t += 1
    A[k] = t
    t += 1
for k in range(N+1,2*N-1):
    while x-1 <= t <= x+1:
        t += 1
    A[k] = t
    t += 1
print("Yes")
print(*A, sep="\n")

Solution (Python):
n,x=map(int,input().split())
if x==1 or x==2*n-1:print("No")
elif n==x:
    print("Yes")
    for i in range(1,2*n):print(i)
else:
    print("Yes")
    a=list(range(1,x-1))
    a.extend(list(range(x+2,2*n)))
    a.insert(n-2,x+1)
    a.insert(n-1,x)
    a.insert(n,x-1)
    for i in a:print(i)

Solution (Python):
N,x=map(int,input().split())

if x==1 or x==2*N-1:
  print('No')
  exit()

print('Yes')

r=[x-1,x,x+1]
tmp=list(range(1,x-1))+list(range(x+2,2*N))

ans=tmp[:N-2]+r+tmp[N-2:]

for a in ans:
  print(a)

Solution (Python):
n,x = map(int, input().split())

if x == 1 or x==2*n-1:
    print('No')
else:
    print('Yes')
    l = [i for i in range(1,2*n)]
    l.remove(x-1)
    l.remove(x)
    l.remove(x+1)
    j=0
    for i in range(n-2):
        print(l[i])
    print(x-1)
    print(x)
    print(x+1)
    for i in range(n-2):
        print(l[n-2+i])

Solution (Python):
a,b=map(int,input().split())
if b<2 or b>2*a-2:print("No")
else:
    print("Yes")
    d=[i for i in range(1,b-1)]+[i for i in range(b+1,a+1)]+[b-1,b]+[i for i in range(a+1,2*a)]if 1<=b<a+1else[i for i in range(1,a)]+[b,b+1]+[i for i in range(a,b)]+[i for i in range(b+2,2*a)]
    for i in d:print(i)

Solution (Python):
n, x = map(int, input().split())
if x == 1 or x == (2 * n - 1):
    print("No")
    exit()

print("Yes")

r = [x - 1, x, x + 1]
tmp = list(range(1, x - 1)) + list(range(x + 2, 2 * n))

ans = tmp[:n - 2] + r + tmp[n - 2:]

for i in ans:
    print(i)

Solution (Python):
n, x = map(int, input().split())
if x == 1 or x == (2 * n - 1):
    print("No")
    exit()

print("Yes")

r = [x - 1, x, x + 1]
tmp = list(range(1, x - 1)) + list(range(x + 2, 2 * n))

ans = tmp[n - 2:] + r + tmp[:n - 2]

for i in ans:
    print(i)

Solution (Python):
n, x = map(int, input().split())

if x == 1 or x == 2*n-1:
  print('No')
else:
  print('Yes')
  if n == 2:
    print(*[1,2,3], sep='\n')
  elif x == 2:
    ans = [3, 2, 1, 4]
    remain = [i for i in range(5, 2*n)]
    ans = remain[:len(remain) // 2] + ans + remain[len(remain) // 2:]
    print(*ans, sep='\n')
  else:
    ans = [x-1, x, x+1, x-2]
    remain = [i for i in range(1, x-2)] + [i for i in range(x+2, 2*n)]
    ans = remain[:len(remain) // 2] + ans + remain[len(remain) // 2:]
    print(*ans, sep='\n')

Solution (Python):
n, x = map(int, input().split())
if x == 1 or x == 2*n-1:
    print("No")
else:
    print("Yes")
    if n == 2:
        print(1)
        print(2)
        print(3)
    else:
        a = [0 for i in range(2*n-1)]
        if x == 2*n-2:
            a[n-3] = x-2
            a[n-2] = x+1
            a[n-1] = x
            a[n] = x-1
        else:
            a[n-3] = x+1
            a[n-2] = x-1
            a[n-1] = x
            a[n] = x+2
        y = 1
        for i in range(2*n-1):
            if y == x-1:
                y = x+3
            if a[i] == 0:
                a[i] = y
                y += 1
        for t in a:
            print(t)

Solution (Python):

from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LS()
    return l
sys.setrecursionlimit(1000000)
mod = 1000000007


def A():
    x = S()
    s = 0
    ans = len(x)
    for i in x:
        if i == "S":
            s += 1
        else:
            if s > 0:
                s -= 1
                ans -= 2
    print(ans)
    return


def B():
    n = I()
    a = LI()
    f = [0 for i in range(n+1)]
    for i in range(n):
        f[a[i]] = i
    l = [i for i in range(n+1)]
    r = [i for i in range(n+1)]
    ans = 0
    for i in range(1,n+1)[::-1]:
        j = f[i]
        ans += (j-l[j]+1)*(r[j]-j+1)*i
        l[r[j]+1] = l[j]
        r[l[j]-1] = r[j]
    print(ans)
    return


def C():
    n,x = LI()
    if x == 1 or x == 2*n-1:
        print("No")
        quit()
    else:
        ans = [i+1 for i in range(2*n-1)]
        k = x-n
        if k < 0:
            ans = ans[2*n-1+k:]+ans[:2*n-1+k]
        if k > 0:
            ans = ans[k:]+ans[:k]
        print("Yes")
        for i in ans:
            print(i)
    return


def D():
    return


def E():
    return


def F():
    return


def G():
    return


def H():
    return


if __name__ == "__main__":
    C()

Solution (Python):
N,x = map(int,input().split())
if x == 1:
  print('No')
elif x == 2*N-1:
  print('No')
else:
  print('Yes')
  if N == 2:
    for i in range(1,4):
      print(i)
  else:
    if x != 2*N-2:
      L = []
      M = [x+2,x-1,x,x+1]
      for i in range(1,2*N):
        if not i in M:
          L.append(i)
      for j in range(N-2):
        print(L[j])
      for k in range(4):
        print(M[k])
      for l in range(N-3):
        print(L[l+N-2])
    else:
      L = []
      M = [x-2,x,x+1,x-1]
      for i in range(1,2*N):
        if not i in M:
          L.append(i)
      for j in range(N-2):
        print(L[j])
      for k in range(4):
        print(M[k])
      for l in range(N-3):
        print(L[l+N-2])

Solution (Python):
N,x = map(int, input().split())
s = 2*N-1
if x == 1 or x == 2*N-1:
    print("No")
else:
    print("Yes")
    for i in range(s):
        print(1 + (x - N + i) % s)

Solution (Python):
n,x=map(int,input().split())
if n==2and x==2:
    print('Yes',*[1,2,3],sep='\n')
    exit()
a=[[]for _ in range(2*n-1)]
a[n-1]=x
f=[0]*2*n
f[x]=1
try:
    if x>2*n-3:
        a[n-3]=x-2
        a[n-2]=x+1
        a[n]=x-1
        f[x-2]=f[x-1]=f[x+1]=1
    else:
        a[n-3]=x+2
        a[n-2]=x-1
        a[n]=x+1
        f[x-1]=f[x+1]=f[x+2]=1
    if f[0]:
        1/0
except:
    print('No')
    exit()
i=0
for j,v in enumerate(f[1:],1):
    if v:continue
    while a[i]:i+=1
    a[i]=j
print('Yes',*a,sep='\n')

Solution (Python):
n,x=map(int,input().split())
if n==2and x==2:
    print('Yes',*[1,2,3],sep='\n')
    exit()
a=[[]for _ in range(2*n-1)]
a[n-1]=x
f=[0]*2*n
f[x]=1
try:
    if x>2*n-3:
        a[n-3]=x-2
        a[n-2]=x+1
        a[n]=x-1
        f[x-2]=f[x-1]=f[x+1]=1
    else:
        a[n-3]=x+2
        a[n-2]=x-1
        a[n]=x+1
        f[x-1]=f[x+1]=f[x+2]=1
    if f[0]:
        1/0
except:
    print('No')
    exit()
i=0
for j,v in enumerate(f[1:],1):
    if v:continue
    while a[i]:i+=1
    a[i]=j
print('Yes',*a,sep='\n')

Solution (Python):
n,x=map(int,input().split())
A=[i for i in range(1,2*n)]
if x==1 or x==2*n-1:
    print('No')
else:
    print('Yes')
    if n==2:
        print(*A,sep='\n')
    else:
        if x==2:
            T=[3,2,1,4]
        else:
            T=[x-1,x,x+1,x-2]
        S=list(set(A)-set(T))
        ans=S[:n-2]+T+S[n-2:]
        print(*ans,sep='\n')

Solution (Python):
n,x = map(int,input().split())

if x == n:
  print("Yes")
  for i in range(1,2*n):
    print(i)
    
elif 1 < x < n:
  print("Yes")
  for i in range(x+1,n+1):
    print(i)
  for i in range(1,x+1):
    print(i)
  for i in range(n+1,2*n):
    print(i)

elif n < x < 2*n-1:
  print("Yes")
  for i in range(1,n):
    print(i)
  for i in range(x,2*n):
    print(i)
  for i in range(n,x):
    print(i)

else:
  print("No")

Solution (Python):
n, x = map(int, input().split())
if x in [1, 2*n-1]:
    print("No")
else:
    print("Yes")
    mid = [x-1,x,x+1]
    if x != 2*n-2:
        mid = [x+2]+mid
    if x != 2:
        mid += [x-2]
    hoge = [i for i in range(1,2*n) if i not in mid]
    ans = hoge[:n-2] + mid + hoge[n-2:]
    print(*ans,sep="\n")

Solution (Python):


import sys

INF = float('inf')
MOD = 10 ** 9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()


def main():
    n, x = LI()

    if x == 1 or x == 2 * n - 1:
        print('No')
        return 0

    print('Yes')
    if n < 3:
        print(*[n for n in range(1, 2 * n)], sep='\n')
        return 1

    
    tmp = [x - 1, x, x + 1]

    remain = list(set([n for n in range(1, 2 * n)]) - set(tmp))
    k = n - 2
    tmp = remain[:k] + tmp + remain[k:]
    print(*tmp, sep='\n')

    return 1


main()

Solution (Python):


import sys

INF = float('inf')
MOD = 10 ** 9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()


def main():
    n, x = LI()

    if x == 1 or x == 2 * n - 1:
        print('No')
        return 0

    print('Yes')
    if n < 3:
        print(*[n for n in range(1, 2 * n)], sep='\n')
        return 1

    
    if x == 2:
        tmp = [3, 2, 1, 4]
    else:
        tmp = [x - 1, x, x + 1, x - 2]

    remain = list(set([n for n in range(1, 2 * n)]) - set(tmp))
    k = 3 - n
    tmp = remain[:k] + tmp + remain[k:]
    print(*tmp, sep='\n')

    return 1


main()

Solution (Python):
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**7) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

N, x = li()

if x == 1 or x == 2*N-1:
    print('No')
    
elif N == x == 2:
    print('Yes')
    print(1)
    print(2)
    print(3)
    
else:
    ans = [0]*(2*N-1)
    ans[N-1] = x
    
    if x == 2:
        ans[N-2] = x+2
        ans[N] = x-1
        ans[N+1] = x+1
        used = [x-1,x,x+1,x+2]
        
    else:
        ans[N-2] = x-1
        ans[N] = x+1
        ans[N+1] = x-2
        used = [x-2,x-1,x,x+1]
    
    rem = []
    for i in range(1,2*N):
        if i in used:
            continue
        else:
            rem.append(i)
            
    rem = rem[::-1]
    
    for i in range(2*N-1):
        if N-2 <= i <= N+1:
            continue
        
        else:
            ans[i] = rem.pop()
            
    print('Yes')
    for ai in ans:
        print(ai)

Solution (Python):
N,X = map(int,input().split())
if N == 1:
    print('Yes')
    print(1)
    exit()

if X == 1 or X == 2*N-1:
    print('No')
    exit()
print('Yes')

if N == X:
    ans = list(range(1,2*N))
elif N > X:
    k = N-X
    ans = list(range(2*N-k,2*N)) + list(range(1,2*N-k))
else:
    k = X-N
    ans = list(range(k+1,2*N)) + list(range(1,k+1))

print(*ans, sep='\n')

Solution (Python):
n, x = map(int, input().split())

ans = [i for i in range(1, 2*n)]

if x == 1 or x == 2*n - 1:
    print("No")
    exit()

print("Yes")
ans[n-1], ans[x-1] = ans[x-1], ans[n-1]
ans[n-2], ans[0] = ans[0], ans[n-2]
ans[n], ans[2*n-2] = ans[2*n-2], ans[n]

if n == 2:
    for i in ans:
        print(i)
    exit()

if x < 2*n-2:
    ans[n-3], ans[2*n-3] = ans[2*n-3], ans[n-3]
else:
    ans[n+1], ans[1] = ans[1], ans[n+1]

for i in ans:
    print(i)

Solution (Python):
n,x = map(int,input().split())
if x in (1, 2 * n - 1):
    print('No')
    exit()
res = list(range(1, 2 * n))
res = res[x - n:] + res[:x - n]
print('Yes')
print(*res, sep='\n')

Solution (Python):
N,x = map(int,input().split())
if x in (1, 2 * N - 1):
    print('No')
    exit()
print('Yes')
if N == 2 and x == 2:
    l = [1, 2, 3]
    print(*l, sep='\n')
elif x == 2:
    l = [4, 1, 2, 3]
    rest = list(range(5, 2 * N))
    m = len(rest) // 2
    l = rest[:m] + l + rest[m:]
    print(*l, sep='\n')
elif x == 2 * N - 2:
    l = [x - 2, x + 1, x, x - 1]
    rest = list(range(1, 2 * N - 4))
    m = len(rest) // 2
    l = rest[:m] + l + rest[m:]
    print(*l, sep='\n')
else:
    l = [x + 2, x - 1, x, x + 1, x - 2]
    rest = list(range(1, x - 2)) + list(range(x + 3, 2 * N))
    m = len(rest) // 2
    l = rest[:m] + l + rest[m:]
    print(*l, sep='\n')

Solution (Python):
n, x = map(int, input().split())
if x == 1 or x == 2 * n - 1:
    print("No")
else:
    numli = [i for i in range(1, 2 * n)]
    displayli = [0] * (2 * n - 1)
    if n == 2:
        if x == 2:
            print("Yes")
            for i in range(3):
                print(i + 1)
        else:
            print("No")
    else:
        k = 0
        if x == 2:
            for i in range(-3, 1):
                if abs(i) % 2 == 1:
                    displayli[n + i] = x - i - 1
                    numli.remove(x - i - 1)
                else:
                    displayli[n + i] = x + i + 1
                    numli.remove(x + i + 1)
            for i in range(2 * n - 1):
                if n - 3 <= i <= n:
                    pass
                else:
                    displayli[i] = numli[k]
                    k += 1

        elif x == 2 * n - 2:
            for i in range(-2, 2):
                if abs(i) % 2 == 1:
                    displayli[n + i] = x - i - 1
                    numli.remove(x - i - 1)
                else:
                    displayli[n + i] = x + i + 1
                    numli.remove(x + i + 1)
            for i in range(2 * n - 1):
                if n - 2 <= i <= n + 1:
                    pass
                else:
                    displayli[i] = numli[k]
                    k += 1
        else:
            for i in range(-3, 2):
                if abs(i) % 2 == 1:
                    displayli[n + i] = x - i - 1
                    numli.remove(x - i - 1)
                else:
                    displayli[n + i] = x + i + 1
                    numli.remove(x + i + 1)
            for i in range(2 * n - 1):
                if n - 3 <= i <= n + 1:
                    pass
                else:
                    displayli[i] = numli[k]
                    k += 1

        print("Yes")
        for i in range(2 * n - 1):
            print(displayli[i])

Solution (Python):
N, x = map(int, input().split())
if x == 1 or x == 2 * N - 1:
    print("No")
    exit()

print("Yes")
if N == 2:
    print(1)
    print(2)
    print(3)
    exit()

ans = [-1] * (2 * N - 1)
if x == 2:
    ans[N - 2:N + 2] = [3, 2, 1, 4]
    tmp = 5
    for i in range(2 * N - 1):
        if ans[i] != -1:
            continue
        else:
            ans[i] = tmp
            tmp += 1


else:
    ans[N - 2:N + 2] = [x - 1, x, x + 1, x - 2]
    tmp = x + 2
    for i in range(2 * N - 1):
        if ans[i] != -1:
            continue
        else:
            if tmp >= 2 * N:
                tmp = 1
            ans[i] = tmp
            tmp += 1

for a in ans:
    print(a)

Solution (Python):
N, x = [int(_) for _ in input().split()]

A = list(range(N + 1, 2 * N)) + list(range(1, N + 1))
if x in [1, 2 * N - 1]:
    print('No')
else:
    print('Yes')
    if x > N:
        A[x - N - 1], A[N - 1] = A[N - 1], A[x - N - 1]
    else:
        A[x + N - 2], A[N - 1] = A[N - 1], A[x + N - 2]
    print(*A, sep='\n')