#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m, temp, counter = 0;
  cin >> n >> m;
  vector<vector<int> > v(1e5 + 5);
  map<int, int> mop;
  while (m--) {
    cin >> temp;
    v[mop[temp]].push_back(temp);
    mop[temp]++;
    if (v[counter].size() == n) {
      cout << 1;
      counter++;
    } else
      cout << 0;
  }
  return 0;
}
