import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String a = sc.next(); String b = sc.next(); String ans = "OK"; if((a.charAt(0) == '0') && (a.length() > 1)) ans = "NG"; if((b.charAt(0) == '0') && (b.length() > 1)) ans = "NG"; try { int A = Integer.parseInt(a); int B = Integer.parseInt(b); if((A < 0) || (A > 12345)) ans = "NG"; if((B < 0) || (B > 12345)) ans = "NG"; } catch(NumberFormatException e) { ans = "NG"; } System.out.println(ans); } }