#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<ll, pair<ll, ll> > P3;
const ll MOD = 998244353;
const int IINF = INT_MAX;
const ll LLINF = LLONG_MAX;
const int MAX_N = int(2e5 + 5);
const double EPS = 1e-10;
const int di[] = {0, 1, 0, -1}, dj[] = {1, 0, -1, 0};
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define SORT(v) sort((v).begin(), (v).end())
#define ALL(v) (v).begin(), (v).end()

ll n, dp[4005][4005];
string s;

int main() {
    cin >> s;
    n = s.size()*2;
    dp[0][0] = 1;
    REP(i,n){
        REP(j,n){
            ll k=0, t=0;
            if(i<n/2){
                t = s[i]-'0';
                k = ((i+1)*2)-j-t-i;
            }
            else{
                k = n-j-i;
            }
            if(k>0){
                dp[i+1][j+t] += dp[i][j];
                dp[i+1][j+t] %= MOD;
            }
            if(j+t>0){
                dp[i+1][j-1+t] += dp[i][j];
                dp[i+1][j-1+t] %= MOD;
            }
        }
    }
    
    
    cout << dp[n][0] << endl;
    return 0;
}