#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
#include <tuple>
template <typename T> constexpr T my_abs(const T &x) { return x < 0 ? -x : x; }
using ll = long long;
constexpr int MOD = 998244353;
char str[4005];
int dp[4005][4005];
int main()
{
	// freopen("yahoo2019-F.in", "r", stdin);
	scanf("%s", str);
	int n = strlen(str), ans = 0;
	dp[0][0] = 1;
	for (int i = 0; i < n * 2; i++)
	{
		int sum = 0;
		for (int j = 0; j <= i && j < n; j++)
			sum += str[j] - '0';
		for (int j = 0; j <= i; j++)
		{
			if (!dp[i][j])
				continue;
			if (j < sum)
				(dp[i + 1][j + 1] += dp[i][j]) %= MOD;
			if (i - j < std::min(n, i + 1) * 2 - sum)
				(dp[i + 1][j] += dp[i][j]) %= MOD;
		}
	}
	for (int i = 0; i <= n * 2; i++)
		(ans += dp[n * 2][i]) %= MOD;
	printf("%d\n", ans);
	return 0;
}
