using System; namespace _0446 { class Program { static void Main(string[] args) { var a = Console.ReadLine(); var b = Console.ReadLine(); int x = 0; int y = 0; var f = false; // 文字列が入っていないかをチェック if (int.TryParse(a, out x) && int.TryParse(b, out y)) { // 0<= a,b <= 12345以内かつ、先頭数値が0ではないか if(x >= 0 && x <= 12345 && y >= 0 && y <= 12345) { if (a.Length >= 2 && a.StartsWith("0") || b.Length >= 2 && b.StartsWith("0")) { Console.WriteLine("NG"); } else { Console.WriteLine("OK"); } } else { Console.WriteLine("NG"); } } else { Console.WriteLine("NG"); } } } }