def solve n, k if n < k return 0 elsif k == 1 return solve(n - 1, 2) else return 2 ** (n - k) end end n, k = gets.split.map(&:to_i) p solve(n, k)