toInt :: (String -> Int)
toInt x = read x ::Int

getInts = do
  x <- getLine
  let y = (map$toInt)$words x
  return y
    where
      toInt x = read x ::Int
getInt = do
	x <- getLine
	let y = toInt x
	return y

main = do
	k <- getInt
	ab <- getInts
	let r = [x | x <- [(ab!!0)..(ab!!1)],x`mod`k==0]
	putStr$(\t->if length t>0 then "OK" else "NG") r