($n,$k)=glob<>; print $k==1?$n<3?0:2**($n-$k)-$n-1:2**($n-$k);