puts [gets, gets].all? {|s| s =~ /^([1-9][0-9]*|0)$/ } ? 'OK' : 'NG'