#include using namespace std; int main() { string a,b; cin >> a >> b; bool flag = true; if((a.length() != 1 && a[0] == '0') || (b.length() != 1 && b[0] == '0')) flag = false; for(int i = 0; i < a.length(); i++){ if(!(a[i] >= '0' && a[i] <= '9')) flag = false; } for(int i = 0; i < b.length(); i++){ if(!(b[i] >= '0' && b[i] <= '9')) flag = false; } cout << (flag ? "OK" : "NG") << endl; return 0; }