i=input try: a=int(i()); b=int(i()) except: print() print('NG') exit() if 0 <= a <= 12345 and 0 <= b <= 12345: print('OK') else: print('NG')