#include using namespace std; using ll = long long; #define int ll #define endl '\n' #define pb push_back using pi = pair; const int MOD = 998244353; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n; string s; cin >> n >> s; s = '$' + s; vector dp(n + 1); dp[0] = 1; int last = 0; for (int i = 1; i <= n; ++i) { if (s[i] == '1') last = i; dp[i] = dp[i - 1]; if (last) dp[i] = (dp[i] + dp[last - 1]) % MOD; } cout << (dp[n] - dp[n - 1] + MOD) % MOD; }