a = gets.chomp b = gets.chomp arr = [*0..12345] arr = arr.map(&:to_s) if arr.include?(a) && arr.include?(b) puts "OK" else puts "NG" end