import sys

input=sys.stdin.readline

K=int(eval(input()))

A,B=list(map(int,input().split()))

for i in range(1001):

  s=i*K

  if A<=s and s<=B:

    print("OK")

    break

  if 1000<s:

    print("NG")

    break
K=int(eval(input()))

A,B=list(map(int,input().split()))

for i in range(1001):

  s=i*K

  if A<=s and s<=B:

    print("OK")

    break

  if 1000<s:

    print("NG")

    break
import sys

input = sys.stdin.readline
K = int(eval(input()))
A, B = list(map(int, input().split()))
for i in range(1001):
    s = i * K
    if A <= s and s <= B:
        print("OK")
        break
    if 1000 < s:
        print("NG")
        break

K = int(eval(input()))
A, B = list(map(int, input().split()))
for i in range(1001):
    s = i * K
    if A <= s and s <= B:
        print("OK")
        break
    if 1000 < s:
        print("NG")
        break

-import sys - -input = sys.stdin.readline