#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  map<int, int> g;
  vector<int> to_erase;
  for (int i = 0; i < m; i++) {
    int a;
    cin >> a;
    if (g.find(a) == g.end()) {
      g[a] = 1;
    } else {
      g[a]++;
    }
    if (g.size() == n) {
      cout << 1;
      for (auto it = g.begin(); it != g.end(); ++it) {
        g[it->first]--;
        if (g[it->first] == 0) to_erase.push_back(it->first);
      }
      for (int i = 0; i < to_erase.size(); i++) g.erase(to_erase[i]);
      to_erase.clear();
    } else {
      cout << 0;
    }
  }
  return 0;
}
