#include <cstdio>
#include <cstring>
#include <algorithm>
#define M 4010
#define P 998244353
#define int long long

using namespace std;

typedef long long ll;

char ch[M];

int n, S[M], F[M][M];

signed main() {
    scanf("%s", ch + 1), n = strlen(ch + 1);
    for(int i = 1; i <= n; i++) S[i] = S[i - 1] + ch[i] - '0';
    F[0][0] = 1;
    for(int i = 0; i < n * 2; i++)
        for(int j = max((i < n ? i - (2 * i - S[i]) : i - (2 * n - S[n])), 0ll); j <= (i < n ? S[i] : S[n]); j++)
            F[i + 1][j] = (F[i + 1][j] + F[i][j]) % P,
            F[i + 1][j + 1] = (F[i + 1][j + 1] + F[i][j]) % P;
    ll ans = 0;
    printf("%lld\n", (F[2 * n][S[n]] % P + P) % P);
    return 0;
}