#include <bits/stdc++.h>
using namespace std;
string to_string(const string& s) { return '"' + s + '"'; }
string to_string(const bool b) { return (b ? "true" : "false"); }
string to_string(const char* s) { return to_string((string)s); }
string to_string(const char c) {
  string s = "'";
  s += c;
  s += "'";
  return s;
}
template <class T, class U>
string to_string(const pair<T, U>& p) {
  string s = "(";
  s += to_string(p.first);
  s += ", ";
  s += to_string(p.second);
  s += ")";
  return s;
}
template <class T>
string to_string(const T& a) {
  bool first = true;
  string s = "{";
  for (const auto& x : a) {
    if (!first) {
      s += ", ";
    }
    first = false;
    s += to_string(x);
  }
  s += "}";
  return s;
}
void debug_out() { cerr << '\n'; }
template <class Head, class... Tail>
void debug_out(Head head, Tail... tail) {
  cerr << ' ' << to_string(head);
  debug_out(tail...);
}
using ll = long long;
using ld = long double;
const int mod = 1e9 + 7;
const int inf = 1e9 + 100;
const ll inf64 = 7e18l;
int n, k;
string s;
vector<int> z;
void build_z() {
  z.resize(n);
  z[0] = 0;
  int l = 0, r = -1;
  for (int i = 1; i < n; ++i) {
    if (i <= r) {
      z[i] = min(r - i + 1, z[i - l]);
    }
    while (i + z[i] < n && s[i + z[i]] == s[z[i]]) {
      ++z[i];
    }
    if (i + z[i] - 1 > r) {
      r = i + z[i] - 1;
      l = i;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(20);
  cin >> n >> k >> s;
  build_z();
  vector<int> answer(n);
  vector<int> plus(n + 1);
  for (int kk = 1; kk <= n; ++kk) {
    int cnt = 1;
    int ind;
    bool ok = true;
    for (ind = kk; ind < n && cnt != k; ind += kk) {
      if (z[ind] < kk) {
        ok = false;
        break;
      }
      ++cnt;
    }
    if (cnt != k) {
      ok = false;
    }
    if (!ok) {
      continue;
    }
    if (ind - 1 >= n) {
      continue;
    }
    int mn = min(ind == n ? 0 : z[ind], kk);
    ++plus[ind - 1];
    --plus[ind + mn];
  }
  int cnt = 0;
  for (int i = 0; i < n; ++i) {
    cnt += plus[i];
    if (cnt != 0) {
      answer[i] = 1;
    }
  }
  for (int i = 0; i < n; ++i) {
    cout << answer[i];
  }
  return 0;
}
