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,raw_input().split())
ans=[0]*(2*n-1)
if x-1>=1 and x+1<=2*n-1:
    print("Yes")
    ans[(2*n-1)/2]=x
    ans[(2*n-1)/2+1]=x+1
    ans[(2*n-1)/2-1]=x-1
    j=1
    i=0
    while i<2*n-1:
        if j==x or j==x-1 or j==x+1:
            j+=1
            continue
        if ans[i]!=0:
            i+=1
            continue
        else:
            ans[i]=j
            j+=1
            i+=1
    for i in xrange(2*n-1):
        print(ans[i])
else:
    print("No")

Solution (Python):
str = input().split()
N = int(str[0])
x = int(str[1])

if(N-(N-2)<=x<=N+(N-2)):
    print("Yes")
    arr = [0] * (2 * N - 1)
    for i in range(2 * N - 1):
        arr[i] = i

    def flip(a,b):
        arr[a],arr[b]=arr[b],arr[a]

    if(x!=N):
        flip(x-1, N-1)
        if(x<N):
            flip(0, N)
        else:
            flip(2*N-1-1, N-2)

    for i in range(2 * N - 1):
        print(arr[i]+1)
else:
    print("No")

Solution (Python):
N, x = map(int, input().split())
if x == 2 and N == 2:
	print("Yes")
	print(1)
	print(2)
	print(3)
elif x == 1 or x >= 2*N-1:
	print("No")
else:
	print("Yes")
	if x == 2:
		for i in range(5,N+2):
			print(i)
		p = [4,2,1,3]
		for i in p:
			print(i)
		for i in range(N+2,2*N):
			print(i)
	else:
		a = [i for i in range(1,2*N)]
		for i in range(N-3):
			print(a[x-4-i])
		p = [x-1,x,x+1,x-2]
		for i in p:
			print(i)
		for i in range(N-2):
			print(a[(x+1+i)%(2*N-1)])

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

Solution (Python):
n, x = map(int, raw_input().split())
if 2 > x or n*2-2 < x:
    print "No"
    exit()
else:
    r = range(1, 2*n)
    i = x - n
    r = r[i:] + r[:i]
    
    print "Yes"
    for ri in r:
        print ri

Solution (Python):
N, x = map(int, input().split())
Las = 2 * N - 1
NO = "No"
YES = "Yes"

if N == 2:
	if x == 2:
		print(YES)
		for i in range(1, 3+1):
			print(i)
	else:
		print(NO)
else:
	if x >= 3 and x <= Las - 2:
		print(YES)

		cnt = 1
		for i in range(1, N-2):
			if cnt == x - 2:
				cnt += 5
				print(cnt)
				cnt += 1
			else:
				print(cnt)
				cnt += 1
		print(x-2)
		print(x+1)
		print(x)
		print(x-1)
		print(x+2)
		for i in range(1, N-2):
			if cnt == x - 2:
				cnt += 5
				print(cnt)
				cnt += 1
			else:
				print(cnt)
				cnt += 1
	elif x == 2:
		print(YES)
		flag = True
		for i in range(1, Las + 1):
			if i == N - 1:
				print(1)
			elif i == N:
				print(2)
				flag = False
			elif flag:
				print(i + 2)
			else:
				print(i)
	elif x == Las - 1:
		print(YES)
		flag = True
		for i in range(1, Las + 1):
			if i == N - 1:
				print(Las)
			elif i == N:
				print(Las - 1)
				flag = False
			elif flag:
				print(i)
			else:
				print(i-2)
	else:
		print(NO)

Solution (Python):
N, x = map(int, raw_input().split())
if x == 1 or x == 2*N - 1:
    print 'No'
elif x == N:
    print 'Yes'
    for i in range(1, 2*N):
        print i
elif x < N:
    print 'Yes'
    for i in range(N - 1 + x, 0, -1):
        print i
    for i in range(N+x, 2*N):
        print i
else:
    print 'Yes'
    y = 2*N - x
    for i in range(N - 1 + y, 0, -1):
        print 2*N - i
    for i in range(N+y, 2*N):
        print 2*N - i

Solution (Python):

import sys,copy,math,heapq,itertools as it,fractions,re,bisect,collections as coll

def med(a):
    return sorted(a)[1]

def simu(a):
    while len(a) > 1:
        a = [med([a[i], a[i + 1], a[i + 2]]) for i in xrange(len(a) - 2)]
    return a[0]





N, x = map(int, raw_input().split())
d = x - N
if 1 < x <= 2*N - 2:
    print "Yes"
    ans = [(i + d)%(2*N - 1) + 1 for i in xrange(2*N - 1)]
    print "\n".join(map(str, ans))
    
else:
    print "No"

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")
    exit()

print("Yes")
diff = N - x
if diff < 0:
    ans = list(range(1, 2 * N))
    ans = ans[abs(diff):] + ans[:abs(diff)]
elif diff > 0:
    ans = list(range(1, 2 * N))
    ans = ans[2 * N - diff - 1:] + ans[:-diff]
else:
    ans = list(range(1, 2 * N))
for a in ans:
    print(a)

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

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

Solution (Python):
n, x = map(int, raw_input().split())
if n == 2:
    if x == 2:
        print 'Yes'
        print 1
        print 2
        print 3
    else:
        print 'No'
    quit()
if x == 1 or x == 2 * n - 1:
    print 'No'
else:
    print 'Yes'
    a = range(1, 2 * n)
    k = x - n
    a = a[k:] + a[:k]
    for x in a:
        print x

Solution (Python):
import sys

n, x = map(int, raw_input().split())

if x == 1 or x == 2*n - 1:
    print "No"
else:
    print "Yes"
    if n == 2:
        for i in range(3):
            print i+1
        sys.exit()
    if x > (2*n - 1)/2 + 1:
        core = [x-2, x, x+1, x-1]
    else:
        core = [x+1, x, x-1, x+2]

    lst = [i+1 for i in range(2*n - 1) if i+1 not in core]
    ans = []
    for i in range((2*n - 1)/2 - 2):
        ans.append(lst.pop())
    ans.extend(core)
    ans.extend(lst)
    for a in ans:
        print a

Solution (Python):



from itertools import *
def bf(n):
    variations = set()
    for comb in permutations(list(range(1,n+1))):
        top = sim(comb)
        if top not in variations:
            print(top, comb)
            variations.add(top)
        
        
        
    print(variations)

def sim(comb):
    comb = list(comb)
    while len(comb) != 1:
        n_comb = []
        for i in range(len(comb)-2):
            arr = comb[i:i+3]
            arr.sort()
            n_comb.append(arr[1])
        comb = n_comb
        
    return comb[0]







def main():
    N,x = map(int,input().split())
    if N == 1:
        if x == 1:
            print('Yes')
            print(1)
        else:
            print('No')
    else:
        length = N * 2 - 1
        if 2 <= x <= length - 1:
            print('Yes')
            mid = (length + 1) // 2
            if x > mid:
                flip = True
                x = (length + 1 - x)
            else:
                flip = False

            ans = list(range(1,x-1)) + list(range(x+1,mid+1)) + list(range(x-1,x+1)) + list(range(mid+1,length+1))
            

            if flip:
                ans2 = [length + 1 - x for x in ans]
                ans = ans2
            for e in ans:
                print(e)
        else:
            print('No')

main()

Solution (Python):
n, x = (int(_) for _ in input().split())
if x == 1 or x == 2 * n - 1:
    print('No')
    exit()
print('Yes')
if n == 2:
    print('1 2 3')
    exit()
s = set()
for i in range(1, 2 * n):
    s.add(i)
a = [-1 for i in range(1, 2 * n)]
a[n - 1] = x
if x == 2:
    a[n - 2] = 1
    a[n] = 3
    a[n - 3] = 4
else:
    a[n - 2] = x + 1
    a[n] = x - 1
    a[n - 3] = x - 2
for i in a:
    s.discard(i)

for i in range(len(a)):
    if a[i] == -1:
        a[i] = s.pop()        
print(' '.join(str(_) for _ in a))

Solution (Python):
n,x=map(int,raw_input().split())
if n==2 and x==2:
    print("Yes")
    print(1)
    print(2)
    print(3)
    exit()
elif n==2 and x!=2:
    print("No")
    exit()
ans=[0]*(2*n-1)
if x-1>=1 and x+1<=2*n-1:
    print("Yes")
    ans[(2*n-1)/2]=x
    ans[(2*n-1)/2+1]=x+1
    ans[(2*n-1)/2-1]=x-1
    j=1
    i=0
    while i<2*n-1:
        if j==x or j==x-1 or j==x+1:
            j+=1
            continue
        if ans[i]!=0:
            i+=1
            continue
        else:
            ans[i]=j
            j+=1
            i+=1
    for i in xrange(2*n-1):
        print(ans[i])
else:
    print("No")

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

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

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

ans = [i for i in xrange(1, M+1) if i not in core]
ans = ans[:(M-4)/2] + core + ans[(M-4)/2:]
print 'Yes'
for a in ans:
    print a

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

if x==1 or x==2*N-1:
    print "No"
else:
    print "Yes"
    if N==2:
        T = [1,2,3]
    else:
        T = range(1, 2*N)
        T[N-1] = x
        if x<N:
            T[N-3] = 2*N-1
            T[N-2] = 1
            T[N]   = 2*N-2
        else:
            T[N-3] = 1
            T[N-2] = 2*N-1
            T[N]   = 2
        S = set(range(1, 2*N))
        for t in T[N-3:N+1]:
            S.remove(t)
        for i in range(N-3):
            T[i] = S.pop()
        for i in range(N+1, 2*N-1):
            T[i] = S.pop()
    for t in T:
        print t

Solution (Python):



def solve(n, x):
    if x == 1 or x == 2 * n - 1:
        return None
    ans = [0 for _ in range(2 * n - 1)]
    ans[n - 1] = x
    ans[n - 2] = x - 1
    ans[n] = x + 1
    rest = set(range(1, 2 * n)) - {x - 1, x, x + 1}
    for i in range(2 * n - 1):
        if ans[i] == 0:
            ans[i] = rest.pop()
    return ans


def main():
    n, x = (int(y) for y in input().split())
    ans = solve(n, x)
    if ans is None:
        print("No")
    else:
        print("Yes")
        print(*ans, sep="\n")


if __name__ == '__main__':
    main()