package yukicoder; import java.util.Scanner; public class Q446 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); boolean correct = true; for (int t = 0; t < 2; ++t) { String s = sc.next(); boolean ok = false; for (int i = 0; i <= 12345; ++i) { if (String.valueOf(i).equals(s)) { ok = true; } } correct &= ok; } if (correct) { System.out.println("OK"); } else { System.out.println("NG"); } sc.close(); } }