#include #include using namespace std; int main() { string a, b; cin >> a >> b; bool f = true; for (int i = 0; i < a.size(); i++) { f &= isdigit(a[i]); } for (int i = 0; i < b.size(); i++) { f &= isdigit(b[i]); } if ( (a[0] != '0' || a.size() == 1) && (b[0] != '0' || b.size() == 1) && f) { int A = stoi(a), B = stoi(b); if (A <= 12345 && B <= 12345) { cout << "OK" << endl; } else { cout << "NG" << endl; } } else { cout << "NG" << endl; } return 0; }