#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  string str;
  cin >> str;
  int *p = new int[n + 1];
  p[0] = p[1] = 0;
  for (int i = 1; i < n; i++) {
    int k = p[i];
    while (k > 0 && str[k] != str[i]) k = p[k];
    if (str[k] == str[i]) k++;
    p[i + 1] = k;
  }
  for (int i = 1; i <= n; i++) {
    int ok = 0;
    if (i >= k) {
      int sl = i - p[i];
      int sc = i / sl;
      int ab = sc / k * sl;
      int a = sc % k * sl + i % sl;
      if (ab - a > 0 || (a > 0 && ab == a)) ok = 1;
    }
    cout << ok;
  }
  cout << endl;
}
