#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T qmin(const T a, const T b) {
  return a < b ? a : b;
}
template <typename T>
inline T qmax(const T a, const T b) {
  return a > b ? a : b;
}
template <typename T>
inline void getmin(T &a, const T b) {
  if (a > b) a = b;
}
template <typename T>
inline void getmax(T &a, const T b) {
  if (a < b) a = b;
}
inline void fileio(string s) {
  freopen((s + ".in").c_str(), "r", stdin);
  freopen((s + ".out").c_str(), "w", stdout);
}
const int inf = 1e9 + 7;
const long long linf = 1e17 + 7;
const int N = 2e6 + 7;
char s[N];
int f[N], n, k;
int main() {
  scanf("%d%d%s", &n, &k, s);
  f[0] = f[1] = 0;
  for (int i = 1, j; i < n; ++i) {
    j = f[i];
    while (j && s[i] != s[j]) j = f[j];
    f[i + 1] = (s[i] == s[j] ? j + 1 : 0);
  }
  for (int i = 0; i < n; ++i) {
    int len = i + 1, cyc = i + 1 - f[i + 1],
        ul = len / (k + 1) + (len % (k + 1) == 0 ? 0 : 1), ur = len / k;
    if (ur <= 0 || ur / cyc * cyc < ul)
      printf("0");
    else
      printf("1");
  }
  puts("");
  return 0;
}
