#include <bits/stdc++.h>
using namespace std;
int main() {
  long n, m, arreglo[100005], cont[100005];
  memset(cont, 0, sizeof(cont));
  set<long> s[100005];
  cin >> n >> m;
  for (long i = 0; i < m; i++) {
    cin >> arreglo[i];
    s[cont[arreglo[i]]].insert(arreglo[i]);
    if (s[cont[arreglo[i]]].size() == n)
      cout << "1";
    else
      cout << "0";
    cont[arreglo[i]]++;
  }
  cout << endl;
  return 0;
}
