#include using namespace std; typedef long long ll; bool lzero(string s) { return s.size() > 1 && s[0] == '0'; } bool isnum(string s) { for (char c : s) if (c < '0' || '9' < c) return false; return true; } int main() { string a, b; cin>>a>>b; if (lzero(a)||lzero(b)||!isnum(a)||!isnum(b)||stoi(a)>12345||stoi(b)>12345) puts("NG"); else puts("OK"); return 0; }