def solve(N,K): if K==1: return 0 else: return pow(2,N-K) N,K=map(int,input().split()) print(solve(N,K))