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