#include #include using namespace atcoder; #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using mint = modint998244353; int main() { cin.tie(nullptr) -> sync_with_stdio(false); int n; string a; cin >> n >> a; vector b; for (int i = 0; i < n;) { int j = i; while (j < n and a[j] == a[i]) ++j; b.push_back(j-i); i = j; } mint ans = 1; int st = (a[0] == '0' ? 0 : 1); for (int i = st; i+1 < b.size(); i += 2) { ans *= b[i]+b[i+1]+1; } cout << ans.val() << '\n'; return 0; }