#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
using namespace std;
template <class T>
inline bool setmin(T &a, T b) {
  if (a > b) return a = b, 1;
  return 0;
}
template <class T>
inline bool setmax(T &a, T b) {
  if (a < b) return a = b, 1;
  return 0;
}
template <class T>
inline T fast(T a, T b, T mod) {
  long long res = 1;
  while (b) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return res;
}
template <class T>
istream &operator>>(istream &os, vector<T> &container) {
  for (auto &u : container) os >> u;
  return os;
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &container) {
  for (auto &u : container) os << u << " ";
  return os;
}
template <class T>
inline T gcd(T a, T b) {
  while (b) swap(a %= b, b);
  return a;
}
const long long INF = 1e9 + 7;
const long long mod = 998244353;
const long long BIG_INF = 1e18 + 7;
const long long N = 1e6 + 7;
const long long T = 1 << 20;
const long double inf = 1e18;
long long n, m, q;
string second;
vector<vector<long long> > operator*(vector<vector<long long> > &a,
                                     vector<vector<long long> > &b) {
  int x = (int)(a).size();
  vector<vector<long long> > ret =
      vector<vector<long long> >(x, vector<long long>(x));
  for (int i = 0; i < (x); i++)
    for (int j = 0; j < (x); j++)
      for (int k = 0; k < (x); k++)
        ret[i][j] = (ret[i][j] + a[i][k] * b[k][j]) % INF;
  return ret;
}
void wypisz(vector<vector<long long> > xd) {
  for (auto &u : xd) {
    cout << u << endl;
  }
  cout << endl;
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  cin >> second;
  vector<vector<long long> > przedostatnia(n + 2, vector<long long>(n + 2)),
      ostatnia = przedostatnia, beka = przedostatnia;
  for (int i = 0; i < (n + 1); i++) {
    przedostatnia[i][i] = 1;
    ostatnia[i][i] = 1;
  }
  for (int i = 0; i < n; i++) {
    if (second[i] == '1') {
      if (i + 1 == n) ostatnia[i][i + 2]++;
      ostatnia[i][i + 1]++;
    } else {
      if (i + 1 == n) przedostatnia[i][i + 2]++;
      przedostatnia[i][i + 1]++;
    }
  }
  przedostatnia[0][0] = 2;
  ostatnia[0][0] = 2;
  przedostatnia[n + 1][n + 1] = 2;
  ostatnia[n + 1][n + 1] = 2;
  beka[0][0] = 1;
  for (int i = 2; i <= m; i++) {
    vector<vector<long long> > xd = ostatnia * przedostatnia;
    przedostatnia = ostatnia;
    ostatnia = xd;
  }
  beka = beka * (m == 0 ? przedostatnia : ostatnia);
  cout << beka[0][n + 1] << '\n';
}
