A = input() B = input() if A.isdecimal() and B.isdecimal(): if int(A) <= 12345 and int(B) <= 12345: print("OK") exit() print("NG")