import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String A = sc.next(); String B = sc.next(); if (checkFormat(A) && checkFormat(B)) { System.out.println("OK"); } else { System.out.println("NG"); } } private static boolean checkFormat(String str) { boolean result = true; for (int i = 0; i < str.length(); i++) { if (!Character.isDigit(str.charAt(i))) { result = false; break; } if (i == 0 && str.charAt(i) == '0' && str.length() > 1) { result = false; break; } } return result; } }