import java.util.Scanner; /** * Created by nullzine on 2017/01/13. */ public class Main { public static void main(String[] args){ System.out.println(new Main().run()); } private String run(){ Scanner sc = new Scanner(System.in); int aa,bb; String a,b; a = sc.nextLine(); b = sc.nextLine(); if(zeroValidation(a)||zeroValidation(b)){ return "NG"; } try{ aa=Integer.parseInt(a); bb=Integer.parseInt(b); }catch(NumberFormatException e){ return "NG"; } return aa<=12345&&bb<=12345?"OK":"NG"; } private boolean zeroValidation(String str){ return !str.equals("0")&&str.charAt(0)=='0'; } }