a = input() b = input() def judge(a, b): if a.isdigit() and b.isdigit(): if not int(a) == a and not int(b) == b: if int(a) <= 12345 and int(b) <= 12345: return 'OK' return 'NG' print(judge(a, b))