#include using namespace std; bool solve() { string A, B; cin >> A >> B; for (char x : A) if (!isdigit(x)) return false; for (char x : B) if (!isdigit(x)) return false; if (A != "0" && A[0] == '0') return false; if (B != "0" && B[0] == '0') return false; return true; } int main() { puts(solve() ? "OK" : "NG"); }