a,b = gets.chomp.split(" ").map(&:to_i) p (b==1 and a==2)? 0:2**(a-b)