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