import re a=input() b=input() if (re.match(r"[1-9][0-9]*",a) or a=='0') and (re.match(r"[1-9][0-9]*",b) or b=='0'): print("OK") else: print("NG")