A = input() B = input() def f(x): try: return str(int(x)) == x except: return False if f(A) and f(B): print("OK") else: print("NG")