import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); final String A = sc.next(); final String B = sc.next(); for(final char as : A.toCharArray()){ if(!Character.isDigit(as)){ System.out.println("NG"); return; } } for(final char bs : B.toCharArray()){ if(!Character.isDigit(bs)){ System.out.println("NG"); return; } } // - が入ってないから安心 if(A.charAt(0) == '0' && !A.equals("0")){ System.out.println("NG"); return; } if(B.charAt(0) == '0' && !B.equals("0")){ System.out.println("NG"); return; } System.out.println("OK"); } }