n,k=map(int,input().split()) a=0 for i in range(1<>j)&1==1] r=[j for j in range(n) if (i>>j)&1==0] a+=l[0]==k-1 and l[-1]>r[0] print(a)