#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int MAXN = 102;
namespace matrix_ops {
template <typename T>
struct matrix_mod {
  vector<vector<T> > data;
  int n, m;
  matrix_mod(int _n, int _m, T v = T())
      : data(vector<vector<T> >(_n, vector<T>(_m, v))), n(_n), m(_m) {}
  matrix_mod operator*(matrix_mod &other) {
    matrix_mod res(n, other.m);
    for (int i = 0; i < n; i++) {
      for (int k = 0; k < m; k++) {
        for (int j = 0; j < other.m; j++) {
          res.data[i][j] += (data[i][k] * other.data[k][j]) % mod;
          if (res.data[i][j] >= mod) res.data[i][j] -= mod;
        }
      }
    }
    return res;
  }
};
template <typename T>
matrix_mod<T> get_diag_mat(int n, T val) {
  matrix_mod<T> res(n, n);
  for (int i = 0; i < n; i++) res.data[i] = val;
  return res;
}
template <typename T>
ostream &operator<<(ostream &os, vector<T> &v) {
  os << "[";
  for (int i = 0; i < v.size(); i++) {
    if (i) os << ", ";
    os << v[i];
  }
  return os << "]";
}
template <typename T>
ostream &operator<<(ostream &os, matrix_mod<T> &mat) {
  os << "{\n";
  for (auto &row : mat.data) {
    os << '\t' << row << endl;
  }
  return os << "}";
}
}  // namespace matrix_ops
using namespace matrix_ops;
vector<int> prefix(const string &s) {
  vector<int> P(s.size(), 0);
  int k = 0;
  for (int i = 1; i < s.size(); i++) {
    while (k > 0 and s[i] != s[k]) k = P[k - 1];
    if (s[i] == s[k]) k++;
    P[i] = k;
  }
  return P;
}
vector<vector<int> > TT(const string &s, const vector<int> &P) {
  int sz = P.size();
  vector<vector<int> > res(sz, vector<int>(2, 0));
  auto move_forward = [&](int curr, char c) -> int {
    while (curr > 0 and s[curr] != c) curr = P[curr - 1];
    if (s[curr] == c) curr++;
    return curr == sz ? P[curr - 1] : curr;
  };
  for (int i = 0; i < sz; i++) {
    res[i][0] = move_forward(i, '0');
    res[i][1] = move_forward(i, '1');
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  using field = matrix_mod<long long>;
  int n, x;
  string s;
  cin >> n >> x;
  cin >> s;
  vector<int> P = prefix(s);
  vector<vector<int> > Fail = TT(s, P);
  vector<field> mats(MAXN, field(s.size() + 1, s.size() + 1));
  int last = s.back() - '0';
  for (int dig = 0; dig < 2; dig++) {
    for (int k = 0; k < s.size(); k++) {
      mats[dig].data[k][k]++;
      mats[dig].data[Fail[k][dig]][k]++;
    }
    mats[dig].data.back().back() += 2;
  }
  mats[last].data.back()[s.size() - 1]++;
  for (int i = 2; i < mats.size(); i++) {
    mats[i] = mats[i - 2] * mats[i - 1];
  }
  long long ans = mats[x].data.back().front();
  cout << ans << '\n';
  return 0;
}
