#include #include #include #include using namespace std; typedef long long int ll; int main(){ string s,t; cin >> s >> t; bool ok=true; int n=s.size(); int m=t.size(); if(s[0]=='0'&&n>1){ ok=false; } if(t[0]=='0'&&m>1){ ok=false; } for(int i=0;i12345)ok=false; } if(m==5){ int q=0; for(int i=0;i<5;i++){ q+=(t[i]-'0')*pow(10,4-i); } if(q>12345)ok=false; } if(ok){ cout << "OK" << endl; } else{ cout << "NG" << endl; } }