#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int TESTS = 1;
  while (TESTS--) {
    int n, m, i, x;
    cin >> m >> n;
    int c = max(n, m);
    vector<int> done(c + 5, 0), arr(c + 5, m);
    int curr = 0;
    for (i = 0; i < n; i++) {
      cin >> x;
      arr[done[x]]--;
      done[x]++;
      if (arr[curr] == 0) {
        curr++;
        cout << 1;
      } else
        cout << 0;
    }
  }
  return 0;
}
