#include <bits/stdc++.h>
using namespace std;
int v[100005], a[100005];
int main() {
  int x;
  int k, n, nrcurr = 1;
  cin >> k >> n;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    v[x]++;
    a[v[x]]++;
    if (a[nrcurr] == k) {
      nrcurr++;
      cout << "1";
    } else
      cout << "0";
  }
  return 0;
}
