#include using namespace std; bool check(string& s) { if (s[0] == '0') { return false; } for (char ch : s) { if (!('0' <= ch && ch <= '9')) { return false; } } return true; } int main() { string A, B; cin >> A >> B; cout << (check(A) && check(B) ? "OK" : "NG") << endl; return 0; }