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

const int mod = 998244353;

long long dp[4010][4010];
int cnt[2010];
char s[2010];
int sum[4010];

int main(){
	scanf("%s", s);
	int n = strlen(s);
	for (int i = 1; i <= n; i++){
		cnt[i] = s[i - 1] - '0';
		sum[i] = sum[i - 1] + cnt[i];
	}
	dp[0][0] = 1;
	for (int i = 1; i <= 2 * n; i++){
		for (int j = 0; j <= i; j++){
			if (j <= sum[min(i, n)] && i - j <= 2 * min(i, n) - sum[min(i, n)]){
				if (j) dp[i][j] = (dp[i - 1][j] + dp[i - 1][j - 1]) % mod;
				else dp[i][j] = dp[i - 1][j];
			} 
		}
	}
	long long ans = 0;
	for (int i = 0; i <= 2 * n; i++){
		ans = (ans + dp[2 * n][i]) % mod;
	}
	printf("%lld\n", ans);
	return 0;
}
