//package beg_165;
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner a = new Scanner(System.in);
		int b = a.nextInt();
		String xdrtcfvygbuh = a.nextLine();
		
		String c = a.nextLine();
		String[] list = c.split(" ");
		
		int f = Integer.parseInt(list[0]);
		int l = Integer.parseInt(list[1]);
		boolean check=true;
		for (int i=f;i<=l;i++) {
			if (i%b==0) {
				System.out.println("OK");
				
				check=false;
				break;
			}
		}
		if (check) {
			System.out.println("NG");
		}

	}

} import java.util.*; util.* java public class Main {

	public static void main(String[] args) {
		Scanner a = new Scanner(System.in);
		int b = a.nextInt();
		String xdrtcfvygbuh = a.nextLine();
		
		String c = a.nextLine();
		String[] list = c.split(" ");
		
		int f = Integer.parseInt(list[0]);
		int l = Integer.parseInt(list[1]);
		boolean check=true;
		for (int i=f;i<=l;i++) {
			if (i%b==0) {
				System.out.println("OK");
				
				check=false;
				break;
			}
		}
		if (check) {
			System.out.println("NG");
		}

	}

} Main public static void main(String[] args) {
		Scanner a = new Scanner(System.in);
		int b = a.nextInt();
		String xdrtcfvygbuh = a.nextLine();
		
		String c = a.nextLine();
		String[] list = c.split(" ");
		
		int f = Integer.parseInt(list[0]);
		int l = Integer.parseInt(list[1]);
		boolean check=true;
		for (int i=f;i<=l;i++) {
			if (i%b==0) {
				System.out.println("OK");
				
				check=false;
				break;
			}
		}
		if (check) {
			System.out.println("NG");
		}

	} main {
		Scanner a = new Scanner(System.in);
		int b = a.nextInt();
		String xdrtcfvygbuh = a.nextLine();
		
		String c = a.nextLine();
		String[] list = c.split(" ");
		
		int f = Integer.parseInt(list[0]);
		int l = Integer.parseInt(list[1]);
		boolean check=true;
		for (int i=f;i<=l;i++) {
			if (i%b==0) {
				System.out.println("OK");
				
				check=false;
				break;
			}
		}
		if (check) {
			System.out.println("NG");
		}

	} Scanner a = new Scanner(System.in); a new Scanner(System.in) int b = a.nextInt(); b a.nextInt() a.nextInt a String xdrtcfvygbuh = a.nextLine(); xdrtcfvygbuh a.nextLine() a.nextLine a String c = a.nextLine(); c a.nextLine() a.nextLine a String[] list = c.split(" "); list c.split(" ") c.split c " " int f = Integer.parseInt(list[0]); f Integer.parseInt(list[0]) Integer.parseInt Integer list[0] list 0 int l = Integer.parseInt(list[1]); l Integer.parseInt(list[1]) Integer.parseInt Integer list[1] list 1 boolean check=true; check true for (int i=f;i<=l;i++) {
			if (i%b==0) {
				System.out.println("OK");
				
				check=false;
				break;
			}
		} int i=f; int i=f; i f i<=l i l i++ i++ i {
			if (i%b==0) {
				System.out.println("OK");
				
				check=false;
				break;
			}
		} {
			if (i%b==0) {
				System.out.println("OK");
				
				check=false;
				break;
			}
		} if (i%b==0) {
				System.out.println("OK");
				
				check=false;
				break;
			} i%b==0 i%b i b 0 {
				System.out.println("OK");
				
				check=false;
				break;
			} System.out.println("OK") System.out.println System.out System System.out "OK" check=false check false break; if (check) {
			System.out.println("NG");
		} check {
			System.out.println("NG");
		} System.out.println("NG") System.out.println System.out System System.out "NG" String[] args args public class Main {

	public static void main(String[] args) {
		Scanner a = new Scanner(System.in);
		int b = a.nextInt();
		String xdrtcfvygbuh = a.nextLine();
		
		String c = a.nextLine();
		String[] list = c.split(" ");
		
		int f = Integer.parseInt(list[0]);
		int l = Integer.parseInt(list[1]);
		boolean check=true;
		for (int i=f;i<=l;i++) {
			if (i%b==0) {
				System.out.println("OK");
				
				check=false;
				break;
			}
		}
		if (check) {
			System.out.println("NG");
		}

	}

} public class Main {

	public static void main(String[] args) {
		Scanner a = new Scanner(System.in);
		int b = a.nextInt();
		String xdrtcfvygbuh = a.nextLine();
		
		String c = a.nextLine();
		String[] list = c.split(" ");
		
		int f = Integer.parseInt(list[0]);
		int l = Integer.parseInt(list[1]);
		boolean check=true;
		for (int i=f;i<=l;i++) {
			if (i%b==0) {
				System.out.println("OK");
				
				check=false;
				break;
			}
		}
		if (check) {
			System.out.println("NG");
		}

	}

} Main
//package beg_165;
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner a = new Scanner(System.in);
		int b = a.nextInt();
		String xdrtcfvygbuh = a.nextLine();
		
		String c = a.nextLine();
		String[] list = c.split(" ");
		
		int f = Integer.parseInt(list[0]);
		int l = Integer.parseInt(list[1]);
		boolean check=true;
		for (int i=f;i<=l;i++) {
			if (i%b==0) {
				System.out.println("OK");
				
				check=false;
				break;
			}
		}
		if (check) {
			System.out.println("NG");
		}

	}

}
