($n,$m)=glob<>; if($n<=$m){ print 1; }elsif($n%2==0 && $n<=$m*2){ print 2; }else{ print -1; }