main = do
    k <- readInt <$> getLine
    [a, b] <- map readInt . words <$> getLine
    putStr $ solve k a b

readInt :: String -> Int
readInt = read

solve k a b
    | a `mod` k == 0 = "OK"
    | b `mod` k == 0 = "OK"
    | a `div` k /= b `div` k = "OK"
    | otherwise = "NG"