#include #include using namespace std; using ll = long long; #define rep(i, s, t) for (ll i = s; i < (ll)(t); i++) #define all(x) begin(x), end(x) template bool chmin(T& x, T y) { return x > y ? (x = y, true) : false; } template bool chmax(T& x, T y) { return x < y ? (x = y, true) : false; } using mint = atcoder::modint998244353; void solve() { int n; cin >> n; string s; cin >> s; s.insert(s.begin(), '1'); s.push_back('0'); vector> vp = {{s[0], 0}}; for (char c : s) { if (vp.back().first == c) vp.back().second++; else vp.push_back({c, 1}); } int m = vp.size(); mint ans = 1; for (int i = 1; i < m - 1; i += 2) { ans *= vp[i].second + vp[i + 1].second + 1; } cout << ans.val() << '\n'; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout << fixed << setprecision(15); int t = 1; // cin >> t; while (t--) solve(); }