try: a,b=int(input()),int(input()) if 0<=a+b<=12345: print('OK') else: print('NG') except: print('NG')