S=gets.chop
N=S.size
d=(1..4001).map{[0]*4001}
d[0][0]=1
x=y=0
(0..2*N-1).map{|i|
	S[i]&&y=2*i+2-x+=S[i].to_i
	(0..i).map{|j|
		[0,1].map{|k|
			j+1-k<=x&&i-j+k<=y&&(
				d[j+1-k][i-j+k]+=d[j][i-j]
				d[j+1-k][i-j+k]%=998244353
			)
		}
	}
}
p d[x][y]
