a=input() b=input() if a.isdigit()==0 or b.isdigit()==0:print("NG") elif a!="0" and a[0]=="0" or b!="0" and b[0]=="0":print("NG") else:print("OK")