n,k=map(int,input().split()) t=2**k;cnt=0 if t==1: print(2**n) exit() for i in range(1,2**n+1): cnt+=i%t==0 print(cnt)