program trk;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var a,b,x:integer;
begin
  readln(a,b);
  if (a=0) and (b<>0) then writeln('NO')
                      else if (a=0) and (b=0) then writeln('INF')
                                              else if -b mod a=0 then begin x:=-b div a; writeln(x); end
                                                                 else writeln('NO');
end.


