#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
const double pi = acos(-1.0);
const int INF = 0x3f3f3f3f;
const int N = 1e6;
int Next[N + 5];
void getNext(string t) {
  memset(Next, 0, sizeof(Next));
  int j, k;
  j = 0;
  k = -1;
  Next[0] = -1;
  while (j < t.length())
    if (k == -1 || t[j] == t[k]) {
      k++;
      j++;
      Next[j] = k;
    } else
      k = Next[k];
}
int ans[N + 5];
int main() {
  ios::sync_with_stdio(false);
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  n = s.length();
  getNext(s);
  memset(ans, 0, sizeof(ans));
  for (int i = 1; i <= n; i++) {
    int len = i - Next[i];
    int m = i / len;
    if (m * len == i) {
      int len0 = (m / k), left = m % k;
      if (len0 >= left) ans[i] = 1;
      continue;
    }
    int len0 = (m / k) * len, left = i - len0 * k;
    if (len0 > left) ans[i] = 1;
  }
  for (int i = 1; i <= n; i++) {
    cout << ans[i];
  }
  return 0;
}
