a = input() b = input() if not (a[0] == '0' and len(a) > 1) and not (b[0] == '0' and len(b) > 1) and (a.isdigit() and b.isdigit()): print('OK') else: print('NG')