#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod=998244353;
const int maxn=2010;
int n,s[maxn];
ll dp[maxn][maxn*2],ans,C[maxn][maxn*2];
char S[maxn];
int main() {
	scanf("%s",S+1); n=strlen(S+1);
	for (int i=0;i<=n;i++) {
		C[i][0]=C[i][i]=1;
		for (int j=1;j<i;j++)
			C[i][j]=(C[i-1][j-1]+C[i-1][j])%mod;
	}
	for (int i=1;i<=n;i++) s[i]=s[i-1]+S[i]-'0';
	dp[0][0]=1;
	for (int i=1;i<=n;i++)
	for (int j=0;j<=s[i];j++) {
		if (2*i-s[i]<i-j) continue;
		dp[i][j]=dp[i-1][j];
		if (j) dp[i][j]=(dp[i][j]+dp[i-1][j-1])%mod;
		if (i==n) ans=(ans+dp[i][j]*C[n][s[n]-j])%mod;
	}
	printf("%lld\n",ans);
	return 0;
}