import java.util.*; import java.io.*; public class Main { static final int MOD = 1000000007; public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); try { for (int i = 0; i < 2; i++) { String a = br.readLine(); int x = Integer.parseInt(a); if (!a.equals(String.valueOf(x)) || x > 12345) { throw new Exception(); } } System.out.println("OK"); } catch(Exception e) { System.out.println("NG"); } } }