def main(): A = input() B = input() try: A_num = int(A) except ValueError: print("NG") return try: B_num = int(B) except ValueError: print("NG") return if A != str(A_num) or B != str(B_num): print("NG") return print("OK") if __name__ == "__main__": main()