#include #include #include using namespace std; using namespace atcoder; using mint = modint998244353; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf32 1000000001 #define Inf64 4000000000000000001LL int main(){ int n; cin>>n; string s; cin>>s; vector dp; int pos = -1; rep(i,n){ if(s[i]=='0'){ pos = i;break; } } if(pos==-1){ mint ans = 1; rep(i,n)ans *= i+1; cout< ndp(dp.size()); rep(j,dp.size()){ ndp[j] = dp[j] * (i-j); } dp = ndp; continue; } vector ndp(i+1); while(dp.size()!=ndp.size())dp.push_back(0); rep(j,dp.size()-1)ndp[j+1] += dp[j] * (j+1); rep(j,dp.size()-1){ dp[j+1] += dp[j]; } rep(j,dp.size()-1)ndp[j+1] += dp[j]; dp = ndp; } mint ans = 0; rep(i,dp.size())ans += dp[i]; cout<