A = input() B = input() if (len(A) == 1 or A[0] == '0') and (len(B) == 1 or B[0] == '0'): try: A = int(A) B = int(B) print('OK') except: print('NG') else: print('NG')