#include using namespace std; int main(){ string A,B; cin>>A>>B; bool ng=(A.length()<=5)&&(B.length()<=5)||!(A.length()>1&&A[0]=='0')||!(B.length()>1&&B[0]=='0'); bool sizeng=true; for(int i=0; i'9')ng=false; if(sizeng)sizeng&=A[i]<=i+1; } for(int i=0; i'9')ng=false; if(sizeng)sizeng&=B[i]<=i+1; } cout<<((ng&&sizeng)?("OK"):("NG"))<