#include <bits/stdc++.h>
using namespace std;
int mod = 1e9 + 7;
char s[105];
int jump[105];
int n, x;
vector<string> fibs;
vector<long long> lengths;
long long powmod(long long a, int e) {
  long long ans = 1;
  while (e) {
    if (e & 1) ans = (ans * a) % mod;
    a = (a * a) % mod;
    e >>= 1;
  }
  return ans;
}
vector<vector<long long> > createCount(int idx) {
  vector<vector<long long> > result(n);
  for (int i = 0; i < n; ++i) {
    auto& ans = result[i];
    ans.resize(n);
    vector<long long> tans(n);
    ans[i] = 1;
    for (int j = 0; j < fibs[idx].size(); ++j) {
      fill(tans.begin(), tans.end(), 0);
      for (int k = 0; k < n; ++k) {
        int x = k;
        while (x > -1 && (s[x] != fibs[idx][j] || x == n - 1)) x = jump[x];
        tans[x + 1] = (tans[x + 1] + ans[k]) % mod;
      }
      for (int k = 0; k < n; ++k) tans[k] = (tans[k] + ans[k]) % mod;
      ans = tans;
    }
  }
  return result;
}
vector<long long> createAns(int idx) {
  vector<long long> ans(n + 1);
  ans[n] = 1;
  vector<long long> tans(n + 1);
  for (int i = lengths[idx] - 1; i >= 0; --i) {
    fill(tans.begin(), tans.end(), 0);
    for (int j = 0; j < n; ++j) {
      auto x = j;
      if (x == n - 1 && fibs[idx][i] == s[x]) {
        tans[j] = (tans[j] + ans[n]) % mod;
        x = jump[x];
      }
      while (x > -1 && fibs[idx][i] != s[x]) x = jump[x];
      tans[j] = (tans[j] + ans[x + 1]) % mod;
    }
    for (int j = 0; j < n; ++j) tans[j] = (tans[j] + ans[j]) % mod;
    tans[n] = powmod(2, lengths[idx] - i);
    ans = tans;
  }
  return ans;
}
int main(void) {
  scanf("%d%d\n%s", &n, &x, s);
  fibs = {"0", "1"};
  lengths = {1, 1};
  fibs.reserve(x + 1);
  lengths.reserve(x + 1);
  for (int i = 2; i <= x; ++i) {
    lengths.push_back((lengths[i - 1] + lengths[i - 2]) % (mod - 1));
  }
  int idx = 0;
  while (lengths[idx] < n) ++idx;
  for (int i = 2; i <= idx + 1; ++i) {
    fibs.push_back(fibs[i - 1] + fibs[i - 2]);
  }
  jump[0] = -1;
  for (int i = 1, j = 0; i < n; ++j, ++i, jump[i] = j) {
    while (j > -1 && s[i] != s[j]) j = jump[j];
  }
  if (x == idx) return !printf("%lld\n", createAns(idx)[0]);
  if (x < idx) return !printf("0\n");
  vector<vector<long long> > count[3];
  vector<long long> ans[3];
  for (int i = 0; i < 3; ++i) {
    ans[i].resize(n);
    count[i].resize(n);
    for (int j = 0; j < n; ++j) count[i][j].resize(n);
  }
  for (int i = 0; i < 2; ++i) {
    count[i] = createCount(idx + i);
    ans[i] = createAns(idx + i);
  }
  for (int iter = idx + 1; iter < x; ++iter) {
    for (int i = 0; i < n; ++i)
      for (int j = 0; j < n; ++j) {
        count[2][i][j] = 0;
        for (int k = 0; k < n; ++k) {
          count[2][i][j] =
              (count[2][i][j] + count[1][i][k] * count[0][k][j]) % mod;
        }
      }
    for (int i = 0; i < n; ++i) {
      ans[2][i] = (ans[1][i] * powmod(2, lengths[iter - 1])) % mod;
      for (int j = 0; j < n; ++j)
        ans[2][i] = (ans[2][i] + count[1][i][j] * ans[0][j]) % mod;
    }
    ans[0] = ans[1];
    ans[1] = ans[2];
    count[0] = count[1];
    count[1] = count[2];
  }
  return !printf("%lld\n", ans[1][0]);
}
