a=gets.chomp b=gets.chomp na=a.to_i nb=b.to_i if na.to_s!=a||nb.to_s!=b||a>12345||b>12345 puts "NG" else puts "OK" end