a = input() b = input() for x in (a, b): if not x.isdigit(): print("NG") exit() if str(int(x)) != x: print("NG") exit() print("OK")