#include #include using namespace std; using mint = atcoder::modint998244353; mint res; int main() { int n, m; cin >> n >> m; string x; cin >> x; vector a(n); for(auto &s : a) cin >> s; mint cur = 1; for(int i = m - 1; i >= 0; --i) { if(x[i] == '1') res += cur; cur *= 2; } cout << (res + 1).val() << endl; }