a,b = input(),input() if a.isdigit() and b.isdigit(): if str(int(a))==a and str(int(b))==b: print("OK") else: print("NG") else: print("NG")