N, K = map(int, input().split()) print(pow(2, N-K) - N*(K == 1))