#include using namespace std; #define int long long const int mod = 998244353; signed main(){ int n; cin >> n; string s; cin >> s; vector a; for(int i = 0;i < n;i++) if(s[i] == '1') a.push_back(i); if((int)a.size() == 0) cout << 0; else if((int)a.size() == 1) cout << 1; else{ int ans = 1; for(int j = 0;j < (int)a.size() - 1;j++){ ans *= (a[j + 1] - a[j] + 1); ans %= mod; } cout << ans % mod << endl; } }