#include <bits/stdc++.h>
const long long MaxN = 105;
const long long p = 1e9 + 7;
template <class t>
inline void read(t &s) {
  s = 0;
  register long long f = 1;
  register char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) s = (s << 3) + (s << 1) + (c ^ 48), c = getchar();
  s *= f;
  return;
}
template <class t, class... A>
inline void read(t &x, A &...a) {
  read(x);
  read(a...);
}
template <class t>
inline void write(t x) {
  if (x < 0) putchar('-'), x = -x;
  long long buf[21], top = 0;
  while (x) buf[++top] = x % 10, x /= 10;
  if (!top) buf[++top] = 0;
  while (top) putchar(buf[top--] ^ '0');
  return;
}
inline void setIn(std::string s) {
  freopen(s.c_str(), "r", stdin);
  return;
}
inline void setOut(std::string s) {
  freopen(s.c_str(), "w", stdout);
  return;
}
inline void setIO(std::string s = "") {
  setIn(s + ".in");
  setOut(s + ".out");
  return;
}
template <class t>
inline bool ckmin(t &x, t y) {
  if (x > y) {
    x = y;
    return 1;
  }
  return 0;
}
template <class t>
inline bool ckmax(t &x, t y) {
  if (x < y) {
    x = y;
    return 1;
  }
  return 0;
}
inline long long lowbit(long long x) { return x & (-x); }
long long kmp[MaxN], n, K;
char s[MaxN];
struct Vec {
  long long a[MaxN];
  Vec() { std::memset(a, 0, sizeof a); }
} ans;
struct Node {
  long long a[MaxN][MaxN];
  Node() { std::memset(a, 0, sizeof a); }
  inline Node operator*(const Node &nt) const {
    Node res;
    for (long long k = 0; k <= n; ++k)
      for (long long i = 0; i <= n; ++i)
        for (long long j = 0; j <= n; ++j)
          (res.a[i][j] += a[i][k] * nt.a[k][j]) %= p;
    return res;
  }
  inline Vec operator*(const Vec &nt) const {
    Vec res;
    for (long long k = 0; k <= n; ++k)
      for (long long i = 0; i <= n; ++i) (res.a[i] += a[i][k] * nt.a[k]) %= p;
    return res;
  }
} I, base, f[MaxN];
inline long long calc(long long x, char y) {
  while (x && s[x + 1] != y) x = kmp[x];
  return s[x + 1] == y ? x + 1 : 0;
}
signed main(void) {
  read(n, K);
  std::scanf("%s", s + 1);
  register long long pos = 0;
  for (long long i = 2; i <= n; ++i) {
    while (pos && s[pos + 1] != s[i]) pos = kmp[pos];
    if (s[pos + 1] == s[i]) ++pos;
    kmp[i] = pos;
  }
  for (long long i = 0; i < 2; ++i)
    for (long long j = 0; j < n; ++j) {
      register long long to = calc(j, i + '0');
      if (to == n) ++f[i].a[kmp[n]][j];
      ++f[i].a[to][j], ++f[i].a[j][j];
    }
  f[0].a[n][n] = f[1].a[n][n] = 2;
  ans.a[0] = 1;
  for (long long i = 2; i <= K; ++i) f[i] = f[i - 2] * f[i - 1];
  write((f[K] * ans).a[n]), std::puts("");
  return 0;
}
