N, K = gets.split.map(&:to_i) if K != 1 puts 2.pow(N - K) else puts 2.pow(N - K) - N end