#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int i, j, k;
  int n, m;
  cin >> n >> m;
  int a[m + 5];
  for (i = 0; i < m; i++) {
    cin >> a[i];
  }
  int ca = 0, cb = 0;
  map<int, int> make_pair;
  for (i = 0; i < m; i++) {
    if (make_pair[a[i]] == 0) ca++;
    make_pair[a[i]]++;
    if (ca == n) {
      cout << "1";
      for (j = 1; j <= n; j++) {
        make_pair[j]--;
        if (make_pair[j] == 0) ca--;
      }
    } else
      cout << "0";
  }
  cout << "\n";
  return 0;
}
