#include <bits/stdc++.h>
using namespace std;
ifstream f;
ofstream of;
vector<int> z_function(string s);
vector<int> prefix_function(string s);
vector<int> prefix_function1(string s);
int main() {
  int k, n;
  string s;
  cin >> n >> k;
  std::getline(cin, s);
  std::getline(cin, s);
  vector<int> p = prefix_function(s);
  for (int i = 0; i < n; i++) {
    int ns = i - p[i] + 1;
    int nt = (i + 1) % ns;
    if (nt == 0) nt = ns;
    if (nt == ns) {
      if (i == 128849) {
        int lkk = 0;
      }
      int r = (i + 1) / ns;
      int a1 = r % k;
      int b1;
      b1 = r / k - r % k;
      if (b1 >= 0)
        cout << 1;
      else
        cout << 0;
    } else {
      int r = (i + 1 - nt) / ns;
      if (r / k - r % k > 0)
        cout << 1;
      else
        cout << 0;
    }
  }
  return 0;
}
vector<int> prefix_function(string s) {
  int n = (int)s.length();
  vector<int> pi(n);
  for (int i = 1; i < n; ++i) {
    int j = pi[i - 1];
    while (j > 0 && s[i] != s[j]) j = pi[j - 1];
    if (s[i] == s[j]) ++j;
    pi[i] = j;
  }
  return pi;
}
vector<int> prefix_function1(string s) {
  int n = s.length();
  vector<int> res(n, 0);
  for (int i = 1; i < n; i++) {
    if (s[i] == s[res[i - 1]])
      res[i] = res[i - 1] + 1;
    else {
      int j = res[i - 1];
      while (j > 0) {
        j = res[j - 1];
        if (s[i] == s[j]) {
          res[i] = res[j] + 1;
          break;
        }
      }
    }
  }
  return res;
}
