A = input() B = input() def isNum(s): if s.isdigit() == False: return False if s[0:1] == '0': return False return True if isNum(A) and isNum(B): print("OK") else: print("NG")