program am
implicit none
integer::K
integer::A,B
logical::check=.false.
integer::i

read*,K
read*,A,B
do i=A,B
    if(mod(i,K)==0)check=.true.
end do
print"(A)",merge("OK","NG",check)
contains
end program am