#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
int n, m, f[100005];
set<pair<int, int> > heap;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  int x;
  for (int i = 1; i <= n; i++) {
    heap.insert({0, i});
  }
  int cur = 1;
  for (int i = 1; i <= m; i++) {
    cin >> x;
    f[x]++;
    heap.erase(heap.find({f[x] - 1, x}));
    heap.insert({f[x], x});
    if (heap.begin()->first == cur) {
      cout << 1;
      cur++;
    } else {
      cout << 0;
    }
  }
  return 0;
}
