#include <bits/stdc++.h>
using namespace std;
short Print_Array[20];
template <typename T>
inline void print(T x, char tm = '\n') {
  if (x < 0) putchar('-'), x = -x;
  short sz = 0;
  while (x) Print_Array[sz++] = x % 10, x /= 10;
  if (sz == 0) putchar('0');
  for (int i = sz - 1; i >= 0; i--) putchar('0' + Print_Array[i]);
  putchar(tm);
}
template <typename T>
void cma(T &a, T b) {
  if (b > a) a = b;
}
template <typename T>
void cmi(T &a, T b) {
  if (b < a) a = b;
}
const double eps = 1e-9;
const int oo = 0x3f3f3f3f;
const long long OO = 0x3f3f3f3f3f3f3f3f, mod = 1e9 + 7;
using namespace std;
const int modo = 1000000007;
struct matrix {
  int a[101][101];
  matrix(int t = 1) {
    int i, j;
    for (i = 0; i < 101; i++) {
      for (j = 0; j < 101; j++) {
        if (i == j) {
          a[i][j] = t;
        } else {
          a[i][j] = 0;
        }
      }
    }
  }
  friend matrix operator*(const matrix &a, const matrix &b) {
    matrix c(0);
    int i, j, k;
    for (i = 0; i < 101; i++) {
      for (j = 0; j < 101; j++) {
        for (k = 0; k < 101; k++) {
          c.a[i][k] = (c.a[i][k] + (long long)a.a[i][j] * b.a[j][k]) % modo;
        }
      }
    }
    return c;
  }
};
matrix a[105];
matrix init;
char b[105];
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  scanf("%s", b);
  int i;
  for (i = 0; i < n; i++) {
    if (b[i] == '0') {
      a[0].a[i][i + 1]++;
      if (i == n - 1) {
        int j;
        for (j = i - 1; j >= 0; j--) {
          int k;
          for (k = 0; k <= j; k++) {
            if (b[k] != b[i - j + k]) break;
          }
          if (k > j) break;
        }
        a[0].a[i][j + 1]++;
      }
      int j;
      for (j = i - 1; j >= 0; j--) {
        if (b[j] != '1') continue;
        int k;
        for (k = 0; k < j; k++) {
          if (b[k] != b[i - j + k]) break;
        }
        if (k == j) break;
      }
      a[1].a[i][j + 1]++;
    } else {
      a[1].a[i][i + 1]++;
      if (i == n - 1) {
        int j;
        for (j = i - 1; j >= 0; j--) {
          int k;
          for (k = 0; k <= j; k++) {
            if (b[k] != b[i - j + k]) break;
          }
          if (k > j) break;
        }
        a[1].a[i][j + 1]++;
      }
      int j;
      for (j = i - 1; j >= 0; j--) {
        if (b[j] != '0') continue;
        int k;
        for (k = 0; k < j; k++) {
          if (b[k] != b[i - j + k]) break;
        }
        if (k == j) break;
      }
      a[0].a[i][j + 1]++;
    }
  }
  a[0].a[n][n]++;
  a[1].a[n][n]++;
  for (i = 2; i <= k; i++) {
    a[i] = a[i - 1] * a[i - 2];
  }
  printf("%d\n", a[k].a[0][n]);
  return 0;
}
