n = int(eval(input()))

a, b = list(map(int, input().split()))

k = 1

while True:

    if a <= n*k <= b:

        print("OK")

        exit()

    elif n*k > b:

        print("NG")

        exit()

    else:

        k += 1
import math



k = int(eval(input()))

a, b = list(map(int, input().split()))



if k == 1:

    print("OK")

    exit()

elif a <= k <= b :

    print("OK")

    exit()



cnt = 1

while True:

    tmp = cnt * k

    if a <=  tmp <= b:

        print("OK")

        exit()

    elif b <= tmp:

        print("NG")

        exit()

    cnt += 1 
n = int(eval(input()))
a, b = list(map(int, input().split()))
k = 1
while True:
    if a <= n * k <= b:
        print("OK")
        exit()
    elif n * k > b:
        print("NG")
        exit()
    else:
        k += 1

import math

k = int(eval(input()))
a, b = list(map(int, input().split()))
if k == 1:
    print("OK")
    exit()
elif a <= k <= b:
    print("OK")
    exit()
cnt = 1
while True:
    tmp = cnt * k
    if a <= tmp <= b:
        print("OK")
        exit()
    elif b <= tmp:
        print("NG")
        exit()
    cnt += 1

-n = int(eval(input())) +import math + +k = int(eval(input())) -k = 1 +if k == 1: +    print("OK") +    exit() +elif a <= k <= b: +    print("OK") +    exit() +cnt = 1 -    if a <= n * k <= b: +    tmp = cnt * k +    if a <= tmp <= b: -    elif n * k > b: +    elif b <= tmp: -    else: -        k += 1 +    cnt += 1