N,K = map(int,input().split()) import sys if K == 1: print(0) exit() if K == N: print(1) exit() u = N - K print(2 ** u)