i=input a=i() b=i() if a.isdigit() and 0 <= int(a) <= 12345 and b.isdigit() and 0 <= int(b) <= 12345: print('OK') else: print('NG')