l, r = gets, gets if ([l, r].all? {|x| x.match(/(^0$)|(^[1-9]\d*$)/) and x.to_i <= 12345 }) puts 'OK' else puts 'NG' end