l = [] l.append(input()) l.append(input()) flag = True for s in l: if len(s) == 1 and s == '0': pass elif len(s) > 1 and s[0:1] == '0': flag = False elif s.isdigit(): pass else: flag = False if flag: print('OK') else: print('NG')