package no446; import java.util.Scanner; import java.util.regex.Pattern; public class Main { public static Pattern regex = Pattern.compile("(0|[1-9][0-9]*)"); public static int MAX = 12345; public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = parse(sc.next()); int b = parse(sc.next()); if (0 <= a && a <= MAX && 0 <= b && b <= MAX) { System.out.println("OK"); }else{ System.out.println("NG"); } } public static int parse(String s) { if (regex.matcher(s).matches()) { return Integer.parseInt(s); }else{ return -1; } } }