#include #include #include using namespace std; bool ok(const string& s) { return all_of(s.begin(), s.end(), [](char ch) { return '0' <= ch && ch <= '9'; }) && (s[0] != '0' || s.length() == 1) && (stoi(s) <= 12345); } int main() { string a, b; cin >> a >> b; if (ok(a) && ok(b)) { cout << "OK" << endl; } else { cout << "NG" << endl; } }