using System; class Program { static void Main() { var a_str = Console.ReadLine(); var b_str = Console.ReadLine(); int n; if( int.TryParse(a_str,out n) == false ) End(false); if( a_str[0] == '0' && n != 0 ) End(false); if( int.TryParse(b_str,out n) == false ) End(false); if( b_str[0] == '0' && n != 0 ) End(false); End(true); } static void End(bool flag) { if( flag ) Console.WriteLine("OK"); else Console.WriteLine("NG"); Environment.Exit(0); } }