a = input() b = input() if (len(a) > 1 and a[0] == '0') or (len(b) > 1 and b[0] == '0'): print("NG") exit() try: a = int(a) b = int(b) print("OK") except: print("NG")