try: a,b=input(),input() if (len(a)>1 and a[0]==0) or (len(b)>1 and b[0]==0): print('NG') exit() a,b=int(a),int(b) if 0<=a+b<=12345: print('OK') else: print('NG') except: print('NG')