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