#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
char t[110];
long double f[110] = {1, 1};
long long pw[110] = {2, 2};
long long dp[110][110][110];
int len;
long long solve(int i, int l, int r, int lx, int rx) {
  if (r - l + 1 > f[i]) return 0;
  if (r - l + 1 == 0) return 1;
  long long c = 1;
  if (l == 1) c *= pw[lx];
  if (r == len) c *= pw[rx];
  c %= mod;
  if (i <= 1) {
    if (t[l] == i + '0') {
      return c;
    } else {
      return 0;
    }
  }
  if (dp[i][l][r] != -1) return dp[i][l][r] * c % mod;
  dp[i][l][r] = 0;
  for (int x = l - 1; x <= r; x++) {
    dp[i][l][r] += solve(i - 1, l, x, 101, i - 2) *
                   solve(i - 2, x + 1, r, i - 1, 101) % mod;
  }
  dp[i][l][r] %= mod;
  return dp[i][l][r] * c % mod;
}
int main() {
  memset(dp, -1, sizeof(dp));
  for (int i = 2; i <= 100; i++) {
    f[i] = f[i - 1] + f[i - 2];
  }
  for (int i = 2; i <= 100; i++) {
    pw[i] = (pw[i - 1] * pw[i - 2]) % mod;
  }
  pw[101] = 1;
  int n, x;
  cin >> n >> x;
  cin >> (t + 1);
  len = strlen(t + 1);
  cout << solve(x, 1, len, 101, 101);
  return 0;
}
