#include <bits/stdc++.h>
using namespace std;
const int MAX = 1000005;
int ans[MAX], z[MAX];
int main() {
  ios::sync_with_stdio(false);
  int n, k;
  string s;
  cin >> n >> k >> s;
  int l = 0, r = 0;
  for (int i = 1; i < n; i++)
    if (i >= r) {
      l = r = i;
      while (r < n && s[r] == s[r - l]) r++;
      z[i] = r - l;
    } else {
      int k = i - l;
      if (z[k] < r - i)
        z[i] = z[k];
      else {
        l = i;
        while (r < n && s[r] == s[r - l]) r++;
        z[i] = r - l;
      }
    }
  for (int i = 1; k * i <= n; i++)
    if (z[i] >= (k - 1) * i) {
      int l = k * i;
      int r = min(n + 1, (k + 1) * i + 1);
      while (r - l > 1) {
        int mid = (l + r) / 2;
        if (z[i] >= mid - i)
          l = mid;
        else
          r = mid;
      }
      ans[k * i]++;
      ans[r]--;
    }
  for (int i = 1; i < MAX; i++) ans[i] += ans[i - 1];
  for (int i = 0; i < n; i++) cout << min(ans[i + 1], 1);
  cout << endl;
  return 0;
}
