#include <bits/stdc++.h>
const int inf = (1ll << 30) - 1;
const int maxn = (int)1e5 + 10;
using namespace std;
long long x[111][111][111];
long long y[111][111][111];
int n, m;
int mod = 1000 * 1000 * 1000 + 7;
string second;
int p[111];
void solve() {
  cin >> n >> m;
  cin >> second;
  second += '#';
  for (int i = 1; i <= n; i++) {
    int j = p[i - 1];
    while (j > 0 && second[i] != second[j]) {
      j = p[j - 1];
    }
    if (second[i] == second[j]) j++;
    p[i] = j;
  }
  for (int i = 0; i <= n; i++) {
    x[0][i][i]++;
    int j = i;
    while (j > 0 && second[j] != '0') j = p[j - 1];
    if (second[j] == '0') {
      j++;
      x[0][i][j]++;
      if (j == n) y[0][i][j]++;
    } else
      x[0][i][j]++;
  }
  for (int i = 0; i <= n; i++) {
    x[1][i][i]++;
    int j = i;
    while (j > 0 && second[j] != '1') j = p[j - 1];
    if (second[j] == '1') {
      j++;
      x[1][i][j]++;
      if (j == n) y[1][i][j]++;
    } else
      x[1][i][j]++;
  }
  for (int it = 2; it <= m; it++) {
    for (int i = 0; i <= n; i++) {
      for (int j = 0; j <= n; j++) {
        long long res1 = 0, res2 = 0;
        for (int k = 0; k <= n; k++) {
          res1 += x[it - 1][i][k] * x[it - 2][k][j];
          if (res1 > 1e15) res1 %= mod;
          res2 += y[it - 1][i][k] * x[it - 2][k][j] +
                  x[it - 1][i][k] * y[it - 2][k][j];
          if (res2 > 1e15) res2 %= mod;
        }
        x[it][i][j] = res1 % mod;
        y[it][i][j] = res2 % mod;
      }
    }
  }
  long long sum = 0;
  for (int i = 0; i <= n; i++) {
    sum = (sum + y[m][0][i]) % mod;
  }
  cout << sum << endl;
}
int main() {
  int t = 1;
  for (int i = 1; i <= t; i++) {
    solve();
  }
  return 0;
}
