#include <iostream> #include <string> using namespace std; const int P = 998244353, N = 1e4 + 10, M = 20; int n, m; string s; int dp[1 << M]; int solve() { dp[0] = 1; for (int i = 0; i < n; i++) { for (int j = (1 << (m - 1)) - 1; j >= 0; j--) { int k = (j << 1) | (s[i] - '0'); if (j != 0 || s[i] == '1') dp[k] = (dp[k] + dp[j]) % P; } } int ans = 0; for (int i = 0; i < (1 << m); i++) { ans = (ans + 1ll * i * dp[i]) % P; } return ans; } int solve2() { int ans = 0; for (int i = 0; i < (1 << n); i++) { int cnt = 0; int num = 0; for (int j = 0; j < n; j++) { if (i & (1 << j)) { num = num * 2 + (s[j] - '0'); cnt++; } } if (cnt <= m)(ans += num) %= P; } return ans; } int main() { cin >> n >> m; cin >> s; if (n <= 20) { cout << solve2() << endl; } cout << solve() << endl; return 0; }