get_string(String) :-
  current_input(Input),
  read_string(Input, ' \n', '', _, String).
 
get_number(Number) :-
  get_string(String),
  number_string(Number, String).

main :-
  get_number(K),
  get_number(A),
  get_number(B),
  (A//K=:=B//K -> writeln('OK') ; writeln('NG')).