#include #include #include #include #include #include #include using namespace std; bool check(string s) { for (char c : s) { if (!isdigit(c)) { return false; } } if (s.size() > 1 && s[0] == '0') { return false; } return stoi(s) <= 12345; } int main() { string a, b; cin >> a >> b; bool ret = check(a) && check(b); cout << (ret ? "OK" : "NG") << endl; return 0; }