#include<bits/stdc++.h>
typedef long long LL;
using namespace std;
auto no = [](){cout << "NO"; exit(0);};
auto read = [](){int x; cin >> x; return x;};
#define maxn 4800
const LL mod = 998244353;
LL f[maxn][maxn];
LL b[maxn], s[maxn];
char S[maxn]; 
int main(){
	ios::sync_with_stdio(false);
	cin >> (S + 1);
	int N = strlen(S + 1);
	for(int i = 1; i <= N; i += 1){
		b[i] = S[i] - '0';
		s[i] = s[i - 1] + b[i]; 
	}
	f[0][0] = 1;
	for(int i = 1; i <= 2 * N; i += 1)
		for(int j = 0; j <= 2 * N; j += 1) if(j <= s[min(i, N)] and i - j <= 2 * min(i, N) - s[min(i, N)])
			f[i][j] = ((j ? f[i - 1][j - 1] : 0) + f[i - 1][j]) % mod;
	cout << f[2 * N][s[N]];
}