A, B = [input().strip() for _ in range(2)] ans = A.isnumeric() and B.isnumeric() if ans == True: A, B = int(A), int(B) ans = (A >= 0) and (B >= 0) and (A <= 12345) and (B <= 12345) print(['NG', 'OK'][ans])