#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int n, m;
  cin >> n >> m;
  vector<int> v(m);
  for (int i = 0; i < m; i++) cin >> v[i];
  set<pair<int, int>> ma;
  vector<int> mav(n + 1, 0);
  for (int i = 1; i <= n; i++) ma.insert(make_pair(0, i));
  set<pair<int, int>>::iterator itr;
  int r = 0;
  for (int i = 0; i < m; i++) {
    itr = ma.find(make_pair(mav[v[i]], v[i]));
    ma.erase(itr);
    mav[v[i]]++;
    ma.insert(make_pair(mav[v[i]], v[i]));
    itr = (ma.begin());
    if ((*itr).first >= r + 1) {
      cout << '1';
      r++;
    } else
      cout << '0';
  }
  cout << endl;
  return 0;
}
