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):
N,x = map(int, input().split())

if x == 1 or x == 2*N-1:
    print("No")
else:
    print("Yes")
    L = [0]*(2*N-1)
    flag = False
    if x > N:
        x = 2*N-x
        flag = True
    for i in range(N-1, 2*N-1):
        L[i] = x+i-N+1
    for i in range(N-2, N-x-1, -1):
        L[i] = x+i-N+1
    for i in range(N-x-1, -1, -1):
        L[i] = 2*N-1-i

    if flag:
        for i in range(2*N-1):
            L[i] = 2*N-L[i]
    for l in L:
        print(l)

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")
  else:
    L = [0]*(2*n-1)
    if x == 2:
      L[n-1] = 1
      L[n] = 2
      K = [i for i in range(3, 2*n)]
      for i in range(n-1):
        L[i] = K.pop()
      for i in range(n+1, 2*n-1):
        L[i] = K.pop()
    else:
      L[n-1] = x
      L[n] = x+1
      L[n-2] = 1
      L[n+1] = 2
      K = [i for i in range(1, 2*n) if 3<=i<x or i>x+1]
      for i in range(n-2):
        L[i] = K.pop()
      for i in range(n+2, 2*n-1):
        L[i] = K.pop()
    print(*L, sep="\n")

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

if __name__ == "__main__":
    main()

Solution (Python):
n, x = map(int, input().split())
l = 2 * n - 1

if x == 1 or x == l:
    print('No')
    exit(0)

if n == 2:
    print('Yes\n1\n2\n3')
    exit(0)

ans = list(map(lambda k: (k - n + x) % l + 1, range(l)))
ans[n - 3], ans[n + 1] = ans[n + 1], ans[n - 3]
print('Yes')
for v in ans:
    print(v)

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

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

Solution (Python):
N, x = map(int, input().split())
if N == 2:
    if x != N:
        print("No")
        exit(0)
else:
    if abs(N - x) > N - 2:
        print("No")
        exit(0)
print("Yes")

if N == 2:
    for i in range(3):
        print(i+1)
else:
    left = []
    right = []
    if x < 2 * N - 2:
        ans = [x+2, x-1, x, x+1]
        s = [i for i in range(1, 2*N) if i < x - 1 or i > x+2]
        for i in range((2*N - 5) // 2):
            print(s.pop())
        for i in range(4):
            print(ans[i])
        for i in range(((2*N - 5) // 2) + 1):
            print(s.pop())

    else:
        ans = [x-2, x+1, x, x-1]
        s = [i for i in range(1, 2*N) if i < x - 2 or i > x+1]
        for i in range((2*N - 5) // 2):
            print(s.pop())
        for i in range(4):
            print(ans[i])
        for i in range(((2*N - 5) // 2) + 1):
            print(s.pop())

Solution (Python):


import sys
from itertools import permutations

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

def check(li):
    while len(li) > 1:
        nxt = []
        for i in range(len(li)-2):
            li2 = [li[i], li[i+1], li[i+2]]
            li2.sort()
            nxt.append(li2[1])
        li = nxt.copy()
    return li[0]

N, X = MAP()
M = N*2 - 1










if X == 1 or X == M:
    No()
    exit()

A = [0] * M
A[M//2] = X
if X <= M//2:
    X2 = X - 1
else:
    X2 = X + 1
A[M//2+1] = X2

a = 1
for i in range(M):
    while a == X or a == X2:
        a += 1
    if i == M//2 or i == M//2+1:
        continue
    A[i] = a
    a += 1
Yes()
[print(a) for a in A]

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

if x in [1, 2 * N - 1]:
    print("No")
else:
    print("Yes")
    a = [None] * (2 * N - 1)
    unused = set(range(1, 2 * N))
    a[N - 1] = x
    a[N - 2] = x - 1
    a[N] = x + 1
    unused -= {x - 1, x, x + 1}
    if N - 3 >= 0 and x + 2 <= 2 * N - 1:
        a[N - 3] = x + 2
        unused -= {x + 2}
    if N + 1 < len(a) and x - 2 >= 1:
        a[N + 1] = x - 2
        unused -= {x - 2}
    for i in range(len(a)):
        if a[i] is None:
            a[i] = unused.pop()
    print(" ".join(map(str, a)))

Solution (Python):
N,x = map(int,input().split())
if x==1 or x==2*N-1:
    print("No")
else:
    print("Yes")
    A = [0 for _ in range(2*N-1)]
    hist = [0 for _ in range(2*N)]
    A[N-1] = x
    A[N-2] = x-1
    A[N] = x+1
    hist[x]=1
    hist[x-1]=1
    hist[x+1]=1
    if x>2:
        cur = 1
    else:
        cur = 4
    for i in range(2*N-1):
        if i<N-2 or i>N:
            while hist[cur]==1:
                cur += 1
            A[i] = cur
            hist[cur] = 1
            cur += 1
    for i in range(2*N-1):
        print(A[i])

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

A = [0] * (2*N-1)
D = [i+1 for i in range(2*N-1)]
if X == 2:
    A[N-2] = X
    A[N-1] = X - 1
else:
    A[N-2] = X
    A[N-1] = X + 1
    A[N] = X - 1
    D.remove(X)
    D.remove(X + 1)
    D.remove(X - 1)
    if N >= 3:
        A[N-3] = X - 2
        D.remove(X - 2)
    
for i in range(2 * N - 1):
    if A[i] == 0:
        A[i] = D.pop()
    
print("Yes")
for a in A:
    print(a)

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

if n >= 3:
    if 1 < x < 2*n-1:
        print("Yes")
        A = [0] * (2*n-1)
        V = [0] * (2*n-1 + 1)
        A[n-1] = x
        A[n-2] = x-1
        A[n] = x+1
        V[x-1] = 1
        V[x] = 1
        V[x+1] = 1
        if x == 2:
            A[n-3] = x+2
            V[x+2] = 1
        else:
            A[n+1] = x-2
            V[x-2] = 1
        
        j = 0
        for i in range(1, 2*n-1 + 1):
            while j < 2*n-1 and A[j] != 0:
                j += 1
            if V[i] == 0:
                A[j] = i

        for i in A:
            print(i)
    else:
        print("No")
else:
    if n==2 and x==2:
        print("Yes")
        print(1)
        print(2)
        print(3)
    else:
        print("No")

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

Solution (Python):
import sys

stdin = sys.stdin

ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split())) 
rs = lambda: stdin.readline().rstrip()  

N, x = rl()
if x == 1 or x == 2 * N - 1:
    print('No')
    exit()
answer = [0] * (2*N-1)
mid = N-1
if x <= N:
    answer[mid] = x
    answer[mid-1] = x - 1
    cur = 0
    for y in range(2*N-1, 0, -1):
        while cur == mid or cur == mid-1:
            cur += 1
        if y == x or y == x-1:
            continue
        answer[cur] = y
        cur += 1
else:
    answer[mid] = x
    answer[mid-1] = x + 1
    cur = 0
    for y in range(1, 2*N):
        while cur == mid or cur == mid-1:
            cur += 1
        if y == x or y == x+1:
            continue
        answer[cur] = y
        cur += 1

print('Yes')
print(*answer)

Solution (Python):
def examA():
    N = I()
    S = SI(); T = SI()
    ans = 2*N
    for l in range(N-1,-1,-1):
        flag = True
        for i in range(l+1):
            if S[N-1-i] != T[l-i]:
                flag = False
                break
        if flag:
            ans -=(l+1)
            break
    print(ans)
    return

def examB():
    N, x = LI()
    d = defaultdict(bool)
    if x==1 or x==2*N-1:
        print("No")
        return
    print("Yes")
    ans = [0]*(2*N-1)
    ans[N-1] = x
    d[x] = True

    ans[N] = x+1
    ans[N-2] = x-1
    d[x+1] = True
    d[x-1] = True

    cur = 1
    for j in range(N-2):
        while(d[cur]):
            cur +=1
        ans[j] = cur
        cur +=1
    for j in range(N+1,2*N-1):
        while(d[cur]):
            cur +=1
        ans[j] = cur
        cur +=1
    for v in ans:
        print(v)
    return

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

if __name__ == '__main__':
    examB()

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

"""

import itertools
med = lambda x,y,z: x+y+z-min(x,y,z)-max(x,y,z)
change = lambda A: [med(x,y,z) for x,y,z in zip(A,A[1:],A[2:])]
se = set()
for p in itertools.permutations(range(1,10)):
    q = p[:]
    for _ in range(4):
        q = change(q)
    if q[0] == 2:
        print(p)
    se.add(q[0])
se 
"""



def case2(N,X):
    if X != 2:
        return False
    return [1,2,3]

def solve(N,X):
    if N == 2:
        return case2(N,X)
    if X == 1 or X == N+N-1:
        return False
    se = set(range(1,N+N))
    A = [0] * (N+N-1)
    if X <= N:
        A[N-1] = X
        A[N] = 1
        A[N+1] = X+1
        A[N-2] = X+2
        se -= set([X,1,X+1,X+2])
    else:
        A[N-1] = X
        A[N] = N+N-1
        A[N+1] = X-1
        A[N-2] = X-2
        se -= set([X,N+N-1,X-1,X-2])
    for i in range(N+N-1):
        if not A[i]:
            A[i] = se.pop()
    return A    

A = solve(N,X)
if not A:
    print('No')
else:
    print('Yes')
    print('\n'.join(map(str,A)))

Solution (Python):
N, x = map(int, input().split())
if x in (1, 2*N-1):
    print('No')
else:
    print('Yes')

    ans = list(range(1, 2*N))[x-N:]+list(range(1, 2*N))[:x-N]
    print(*ans, sep='\n')

Solution (Python):
n,x=map(int,input().split())
if n==2:
  if x==2:
    print("Yes",1,2,3,sep="\n")
    exit()
  else:
    print("No")
    exit()
if x==1 or x==n*2-1:
  print("No")
  exit()
ans=[i for i in range(1,2*n)]
for i in range(len(ans)):
  ans[i]=(ans[i]-(n-x+1))%(2*n-1)+1
print("Yes",*ans,sep="\n")

Solution (Python):
N, x = map(int, input().split())
A = [0 for i in range(2 * N - 1)]
if N == 2:
  if x == 2:
    print('Yes')
    print(1)
    print(2)
    print(3)
  else:
    print('No')
elif N >= 3:
  if x == 1 or x == 2 * N - 1:
    print('No')
  elif x > 2 and x < 2 * N - 2:
    A[N - 3], A[N - 2], A[N - 1], A[N], A[N + 1] = 1, 2*N - 1, x, 2, 2*N - 2
    j = 2
    for i in range(2*N-1):
      if i < N - 3 or i > N + 1:
        j += 1
        if j == x:
          j += 1
        A[i] = j
    print('Yes')
    for i in range(2*N-1):
      print(A[i])
  elif x == 2 or x == 2 * N - 2:
    A[N - 2], A[N - 1], A[N] = 1, x, 2*N - 1
    j = 1
    for i in range(2*N-1):
      if i < N - 2 or i > N:
        j += 1
        if j == x:
          j += 1
        A[i] = j
    print('Yes')
    for i in range(2*N-1):
      print(A[i])

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

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

Solution (Python):
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda:sys.stdin.readline().rstrip()

def resolve():
    n,x=map(int,input().split())
    if(x!=1 and x!=2*n-1):
        print("Yes")
    else:
        print("No")
        return

    if(n==2):
        print(1,2,3)
        return

    if(x!=2):
        ans=[i for i in range(1,2*n) if(i not in [x-2,x-1,x,x+1])]
        ans=ans[:n-2]+[x-2,x,x+1,x-1]+ans[n-2:]
        print(*ans)
    else:
        ans=[i for i in range(5,2*n)]
        ans=ans[:n-2]+[1,2,4,3]+ans[n-2:]
        print(*ans)
resolve()

Solution (Python):
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
import itertools
from itertools import permutations,combinations
import sys
import bisect
import string
import math
import time
import random
def I():
    return int(input())
def MI():
    return map(int,input().split())
def LI():
    return [int(i) for i in input().split()]
def LI_():
    return [int(i)-1 for i in input().split()]
def StoI():
    return [ord(i)-97 for i in input()]
def ItoS(nn):
    return chr(nn+97)
def GI(V,E,Directed=False,index=0):
    org_inp=[]
    g=[[] for i in range(n)]
    for i in range(E):
        inp=LI()
        org_inp.append(inp)
        if index==0:
            inp[0]-=1
            inp[1]-=1
        if len(inp)==2:
            a,b=inp
            g[a].append(b)
            if not Directed:
                g[b].append(a)
        elif len(inp)==3:
            a,b,c=inp
            aa=(inp[0],inp[2])
            bb=(inp[1],inp[2])
            g[a].append(bb)
            if not Directed:
                g[b].append(aa)
    return g,org_inp
def show(*inp,end='\n'):
    if show_flg:
        print(*inp,end=end)
YN=['Yes','No']
mo=10**9+7
inf=float('inf')
l_alp=string.ascii_lowercase
u_alp=string.ascii_uppercase
ts=time.time()
sys.setrecursionlimit(10**5)
input=lambda: sys.stdin.readline().rstrip()
 
show_flg=False
show_flg=True

ans=0

n,x=LI()
if x==1 or x==2*n-1:
    print('No')
    exit()
print('Yes')
a=[i for i in range(2,2*n-1) if i!=x]
ans=a[:n-2]+[1,x,2*n-1]+a[n-2:]

for i in range(2*n-1):
    print(ans[i])

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

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

Solution (Python):
n, x = map(int, input().split())
if 1 < x < 2 * n - 1:
	print("Yes")
else:
	print("No")
	exit()
t = list(range(2, 2 * n - 1))
t.remove(x)
ans = t[:n - 2] + [2 * n - 1, x, 1] + t[n - 2:]
print(*ans, sep="\n")

Solution (Python):
N, x = map(int, input().split())
MAX = 2*N - 1
if x in [1, MAX]:
    print('No')
else:
    print('Yes')
    great = [i for i in range(x + 1, MAX + 1)]
    small = [i for i in range(1, x)]
    if len(great) > N - 1:
        small = great[N - 1:] + small
        great = great[:N - 1]
    elif len(small) > N - 1:
        great = great + small[N - 1:]
        small = small[:N - 1]
    ans = small + [x] + great
    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')
    l, r = [1], [2*N-1]
    
    i = 2 * N - 2
    while len(l) < N - 1 :
        if i != x :
            l.append(i)
        i -= 1
    
    i = 2
    while len(r) < N - 1 :
        if i != x :
            r.append(i)
        i += 1
        
    for i in l[::-1] + [x] + r :
        print(i)

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

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

T = list(range(X + 2, 2 * N)) + list(reversed(range(1, X - 1)))
A = T[:N - 2] + [X - 1, X, X + 1] + T[N - 2:]

print("Yes")
print(*A, sep='\n')

Solution (Python):


def solve(n, x):
    if x in {1, n * 2 - 1}:
        return ['No']

    if n == 2:
        a = ['Yes'] + [1, 2, 3]
        return a

    a = [-1] * (n * 2 - 1)
    a[n - 1] = x

    if x == 2:
        a[n - 2] = n * 2 - 2
        a[n] = 1
        a[n + 1] = n * 2 - 1
    else:
        a[n - 2] = 1
        a[n] = n * 2 - 1
        a[n + 1] = 2

    remains = set(range(1, n * 2)) - set(a)
    for ind, a_ in enumerate(a):
        if a_ == -1:
            a[ind] = remains.pop()

    a = ['Yes'] + a
    return a


if __name__ == '__main__':
    n, x = map(int, input().split())
    print(*solve(n, x), sep='\n')

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

if N == 2:
    if x == 2:
        print('Yes')
        print(1)
        print(2)
        print(3)
    else:
        print('No')
    exit()

if x == 1 or x == 2*N-1:
    print('No')
elif x == 2:
    print('Yes')
    for i in range(N-2):
        print(i+3)
    print(1)
    print(2)
    for i in range(N+1, 2*N):
        print(i)
else:
    print('Yes')
    ans = list(range(1, 2*N))
    ans[N-3], ans[x-2] = ans[x-2], ans[N-3]
    ans[N-2], ans[x] = ans[x], ans[N-2]
    ans[N-1], ans[x-1] = ans[x-1], ans[N-1]
    ans[N], ans[x-3] = ans[x-3], ans[N]
    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')
    if x<=n-1:
        for i in range(2,x):
            print(i)
        for i in range(x+1,n+1):
            print(i)
        print(1);print(x);print(2*n-1)
        for i in range(n+1,2*n-1):
            print(i)
    else:
        for i in range(2,n):
            print(i)
        print(1);print(x);print(2*n-1)
        for i in range(n,x):
            print(i)
        for i in range(x+1,2*n-1):
            print(i)

Solution (Python):

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

if x <= 2 or 2*N-x <= 2:

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

    elif N >= 3 and (x == 2):

        print ("Yes")
        notend = [True] * (2*N-1)
        lis = [0] * (2*N-1)

        lis[N-1] = x
        notend[x-1] = False
    
        lis[N] = x-1
        notend[x-1-1] = False

        ind = 0

        for i in range(2*N-1):

            if lis[i] == 0:
            
                while not notend[ind]:
                    ind += 1
    
                lis[i] = ind + 1
                notend[ind] = False
            

        for i in lis:
            print (i)

    elif N >= 3 and (x == 2*N-2):

        print ("Yes")
        notend = [True] * (2*N-1)
        lis = [0] * (2*N-1)

        lis[N-1] = x
        notend[x-1] = False
    
        lis[N] = x+1
        notend[x+1-1] = False

        ind = 0

        for i in range(2*N-1):

            if lis[i] == 0:
            
                while not notend[ind]:
                    ind += 1
    
                lis[i] = ind + 1
                notend[ind] = False
            

        for i in lis:
            print (i)  
        

    else:
        print ("No")
    
else:
    print ("Yes")
    notend = [True] * (2*N-1)
    lis = [0] * (2*N-1)

    lis[N-1] = x
    notend[x-1] = False

    lis[N] = x+1
    notend[x+1-1] = False

    lis[N-2] = x-2
    notend[x-2-1] = False

    lis[N+1] = x-1
    notend[x-1-1] = False

    lis[N-3] = x+2
    notend[x+2-1] = False

    ind = 0

    for i in range(2*N-1):

        if lis[i] == 0:
            
            while not notend[ind]:
                ind += 1

            lis[i] = ind + 1
            notend[ind] = False
            

    for i in lis:
        print (i)

Solution (Python):
n, x = map(int, input().split())
m = 2*n-1

if n==2 and x==2:
    print("Yes")
    print("1\n2\n3")
elif x==1 or x==m:
    print("No")
else:
    if x < n:
        print("Yes")
        base = [str(i) for i in [m, x, 1, m-1]]
        ans = [str(i) for i in range(2, n) if i!=x] + base + [str(i) for i in range(n, m-1)]
        print("\n".join(ans))
    else:
        print("Yes")
        base = [str(i) for i in [1, x, m, 2]]
        ans = [str(i) for i in range(3, n)] + base + [str(i) for i in range(n, m) if i!=x]
        print("\n".join(ans))

Solution (Python):
import sys
input = sys.stdin.buffer.readline
N, x = map(int, input().split())
if N == 2:
  if x == 2:
    print("Yes")
    print(1)
    print(2)
    print(3)
  else:
    print("No")
  exit(0)
if x == 1 or x == 2 * N - 1:
  print("No")
  exit(0)
print("Yes")
if x == 2:
  i = 4
  for _ in range(1, N - 2):
    i += 1
    print(i)
  print(x + 2)
  print(x - 1)
  print(x)
  print(x + 1)
  for _ in range(N + 2, 2 * N):
    i += 1
    print(i)
else:
  i = 0
  for _ in range(1, N - 1):
    if i == x - 3:
      i += 5
    else:
      i += 1
    print(i)
  print(x - 1)
  print(x)
  print(x + 1)
  print(x - 2)
  for _ in range(N + 3, 2 * N):
    if i == x - 3:
      i += 5
    else:
      i += 1
    print(i)

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

if x == 1 or x >= 2 * N - 1:
    print("No")
else:
    m = N
    if x == m:
        print("Yes")

        ans = range(1, 2 * N )
        for i in ans:
            print(i)
    elif x < m:
        print("Yes")
        for i in range(x + 1, m + 1):
            print(i)
        for i in range(1, x + 1):
            print(i)
        for i in range(m + 1 , 2* N):
            print(i)
    else:
        print("Yes")
        for i in range(1,m):
            print(i)
        for i in range(x,N* 2):
            print(i)
        for i in range(m, x):
            print(i)

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

def get_result():
    if x == 1 or x == 2*n-1:
        return []
    
    if n == 2:
        return [1,2,3]
    
    if x == 2:
        center = [3,2,1,4]
        others = list(range(5,2*n))
    elif x == 2*n-2:
        center = [2*n-3,2*n-2,2*n-1,2*n-4]
        others = list(range(1,2*n-4))
    else:
        center = [x+1,x,x-1,x+2]
        others = list(range(1,x-1)) + list(range(x+3,2*n))
    split_idx = n-2
    result = others[:split_idx] + center + others[split_idx:]
    
    return result


res = get_result()
if len(res)==0:
    print("No")
else:
    print("Yes")
    for r in res:
        print(r)

Solution (Python):

def main():
    N, X = map(int, input().split())
    if 1 < X < 2 * N - 1:
        print("Yes")
        ans = list(range(1, 2 * N))
        print("\n".join(map(str, ans[X - N :] + ans[: X - N])))
    else:
        print("No")


if __name__ == "__main__":
    main()

Solution (Python):
N, X = map(int, input().split())
if N == 2:
    if X != 2:
        print('No')
    else:
        print('Yes')
        print(1)
        print(2)
        print(3)
elif X == 1 or X == 2*N-1:
    print('No')
else:
    print('Yes')
    used = [False]*(2*N-1)
    if X >= N:
        p1 = 2*N-1
        s1 = 1
        s2 = 2
    else:
        p1 = 1
        s1 = 2*N-1
        s2 = 2*N-2
    a = 0
    for k in range(1, 2*N):
        if a == N-2:
            print(s1)
            print(X)
            print(p1)
            print(s2)
            a += 4
        if k in [X, p1, s1, s2]:
            continue
        print(k)
        a += 1

Solution (Python):
def getlist():
	return list(map(int, input().split()))

N, x = getlist()
if x == 1 or x == 2 * N - 1:
	print("No")
else:
	print("Yes")
	L = [i for i in range(1, 2 * N)]
	b = [2 * N - 1, x, 1]
	L.remove(2 * N - 1)
	L.remove(x)
	L.remove(1)
	a = L[:N - 2]
	c = L[N - 2:]
	a.reverse()
	c.reverse()
	ans = a + b + c
	for i in range(2 * N - 1):
		print(ans[i])

Solution (Python):
N, x = map(int, input().split())
L = 2 * N - 1
if x == 1 or x == L:
  print('No')
else:
  print('Yes')
  P = [0] * L
  P[L // 2] = x - 1
  P[L // 2 - 1] = x
  P[L // 2 + 1] = x - 2
  for i in range(2, N):
    P[L // 2 - i] = (x - i - 1) % L
    P[L // 2 + i] = (x + i - 1) % L
  print('\n'.join([str(p + 1) for p in P]))

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

Solution (Python):
n, x = map(int,input().split())
ans = [-1]*(2*n - 1)
if x == 1 or x == 2*n - 1:
    print('No')
else:
    if n == 2:
        if x == 3:
            print('No')
        else:
            print('Yes')
            print('1\n2\n3')
    else:
        print('Yes')
        t = 0
        if x == 2:
            ans[n - 3] = 4
            ans[n - 2] = 1
            ans[n - 1] = 2
            ans[n] = 3
            t, i = 1, 0
            for rep in range(10**6):
                if i >= 2*n - 1:
                    break
                if ans[i] == -1:
                    if t > 4:
                        ans[i] = t
                        i += 1
                    t += 1 
                else:
                    i += 1
        else:
            ans[n - 3] = x - 2
            ans[n - 2] = x + 1
            ans[n - 1] = x
            ans[n] = x - 1
            t, i = 1, 0
            for rep in range(10**6):
                if i >= 2*n - 1:
                    break
                if ans[i] == -1:
                    if t < x - 2 or t > x + 1:
                        ans[i] = t
                        i += 1
                    t += 1 
                else:
                    i += 1

        for i in ans:
            print(i)

Solution (Python):
import sys,bisect as bs,collections as cl,heapq as hq
sys.setrecursionlimit(100000)
mod = 10**9+7
Max = sys.maxsize
def l(): 
    return list(map(int,input().split()))
def m(): 
    return map(int,input().split())
def onem(): 
    return int(input())
def s(x): 
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): 
    return " ".join(map(str,x))
def max2(x): 
    return max(map(max,x))
def In(x,a): 
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

n,m = m()

if m == 1 or 2*n-1 == m:
    print("No")
else:
    print("Yes")
    if n == 2:
        ans = [1,2,3]
        for i in range(2*n-1):
            print(ans[i])
    else:
        if m == 2:
            a = [3,2,1,4]
            ans = [i + 5 for i in range(n-2)] + a + [i + n+3 for i in range(n-3)]
        else:
            a = [m-1,m,m+1,m-2]
            i = 0
            ans = []
            for j in range(2*n-4):
                i += 1
                if j == n-2:
                    ans += a
                    i -= 1
                else:
                    if i == m-2:
                        i += 4
                    ans.append(i)
        for i in range(2*n-1):
            print(ans[i])

Solution (Python):
import sys,bisect as bs,collections as cl,heapq as hq
sys.setrecursionlimit(100000)
mod = 10**9+7
Max = sys.maxsize
def l(): 
    return list(map(int,input().split()))
def m(): 
    return map(int,input().split())
def onem(): 
    return int(input())
def s(x): 
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): 
    return " ".join(map(str,x))
def max2(x): 
    return max(map(max,x))
def In(x,a): 
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

n,m = m()

if m == 1 or 2*n-1 == m:
    print("No")
else:
    print("Yes")
    if n == 2:
        ans = [1,2,3]
        print(jo(ans))
    else:
        if m == 2:
            a = [3,2,1,4]
            ans = [i + 5 for i in range(n-2)] + a + [i + n+3 for i in range(n-3)]
        else:
            a = [m-1,m,m+1,m-2]
            i = 0
            ans = []
            for j in range(2*n-4):
                i += 1
                if j == n-2:
                    ans += a
                    i -= 1
                else:
                    if i == m-2:
                        i += 4
                    ans.append(i)
        print(jo(ans))

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

ans=[]
for i in range(len(ll)):
    if i==n-2:
        ans+=l
    ans.append(ll[i])
if len(ll)==n-2:
    ans+=l
print("Yes")
for i in ans:
    print(i)