#include <bits/stdc++.h>
inline int mod(int x) { return x < 1000000007 ? x : x - 1000000007; }
int a[105][2], b[105], f[105][105][105], g[105][105][105], i, j, k, l, m, n;
char c[105];
int main() {
  scanf("%d%d%s", &n, &m, c + 1);
  for (a[0][c[1] ^= 48] = i = 1; i < n; i++)
    c[i + 1] ^= 48,
        b[a[i][c[i + 1]] = i + 1] = a[b[i]][c[i + 1]],
                               a[i][c[i + 1] ^ 1] = a[b[i]][c[i + 1] ^ 1];
  for (i = 0, a[n][0] = a[b[n]][0], a[n][1] = a[b[n]][1]; i <= n; i++)
    f[0][i][i]++, f[0][i][a[i][0]]++, g[0][i][a[i][0]] = a[i][0] == n,
                                      f[1][i][i]++, f[1][i][a[i][1]]++,
                                      g[1][i][a[i][1]] = a[i][1] == n;
  for (i = 2; i <= m; i++)
    for (j = 0; j <= n; j++)
      for (k = 0; k <= n; k++)
        for (l = 0; l <= n; l++) {
          f[i][j][l] =
              (f[i][j][l] + (long long)f[i - 1][j][k] * f[i - 2][k][l]) %
              1000000007;
          g[i][j][l] =
              (g[i][j][l] + (long long)f[i - 1][j][k] * g[i - 2][k][l] +
               (long long)g[i - 1][j][k] * f[i - 2][k][l]) %
              1000000007;
        }
  for (j = k = 0; j <= n; j++) k = mod(k + g[m][0][j]);
  return 0 & printf("%d\n", k);
}
