#include using namespace std; bool solver(string s){ int a=0,p=10000; for(int i=0;i=0&&tmp<=9){ if(a==0&&tmp==0&&s.size()!=1) return false; a+=p*(tmp); p/=10; }else return false; } if(a>12345) return false; return true; } int main(){ string s1,s2; cin >> s1 >> s2; if(solver(s1)&&solver(s2)) cout << "OK" << endl; else cout << "NG" << endl; return 0; }