#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
int gi(){
	int x=0,w=1;char ch=getchar();
	while((ch<'0'||ch>'9')&&ch!='-')ch=getchar();
	if(ch=='-')w=0,ch=getchar();
	while(ch>='0'&&ch<='9')x=(x<<3)+(x<<1)+ch-'0',ch=getchar();
	return w?x:-x;
}
const int N=2005;
const int mod=998244353;
int n,sum[N],C[N][N],f[N][N],ans;char s[N];
int main(){
	scanf("%s",s+1);n=strlen(s+1);
	for(int i=1;i<=n;++i)sum[i]=sum[i-1]+s[i]-'0';
	for(int i=C[0][0]=1;i<=n;++i)
		for(int j=C[i][0]=1;j<=i;++j)
			C[i][j]=(C[i-1][j]+C[i-1][j-1])%mod;
	f[0][0]=1;
	for(int i=1;i<=n;++i)
		for(int j=0;j<=i;++j){
			if(j&&j<=sum[i])f[i][j]=(f[i][j]+f[i-1][j-1])%mod;
			if(j<i&&i-j<=2*i-sum[i])f[i][j]=(f[i][j]+f[i-1][j])%mod;
		}
	for(int i=max(0,sum[n]-n);i<=sum[n]&&i<=n;++i)ans=(ans+1ll*f[n][i]*C[n][sum[n]-i])%mod;
	printf("%d\n",ans);return 0;
}
