#!/bin/sh

while true;
do
        read k
        read a b

        if [ -z "$k" ]; then
                break
        fi

        result=`seq $a $b | awk -v num=$k '($1%num==0){print $1}' | wc -l`

        if [ $result -eq 0 ]; then
                echo "NG"
        else
                echo "OK"
        fi

done