A=input() B=input() if A.isdecimal() and A[0]!='0' and B.isdecimal() and B[0]!='0': print('OK') else: print('NG')