#include <bits/stdc++.h>
using namespace std;

#define rep(i, N) for (int i = 0; i < (N); i++)
#define all(a) (a).begin(), (a).end()
#define pb push_back

using ll = long long;
using i_i = tuple<int, int>;

const int MOD = 998244353;

int main() {
    string s; cin >> s;
    int N = s.length();
    int M = 0;
    vector<int> dp(N * 2 + 1);
    dp[0] = 1;
    rep(t, N * 2) {
        if (t < N) {
            vector<int> _dp(N * 2 + 1);
            int db = s[t] - '0';
            rep(b, N * 2 + 1) if (dp[b])
                _dp[b + db] = dp[b];
            dp = _dp;
            M += 2;
        }
        {
            vector<int> _dp(N * 2 + 1);
            rep(b, N * 2 + 1) if (dp[b]) {
                int r = M - b;
                if (r) _dp[b] = (_dp[b] + dp[b]) % MOD;
                if (b) _dp[b - 1] = (_dp[b - 1] + dp[b]) % MOD;
            }
            dp = _dp;
            M--;
        }
    }
    cout << dp[0] << endl;
}
