import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines A,B = read().split() def is_ok(A): if not A.isdigit(): return False A = int(A) return 0 <= A <= 12345 answer = 'OK' if is_ok(A) and is_ok(B) else 'NG' print(answer)