#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m, x, k = 1;
  cin >> n >> m;
  int cnt[100001] = {}, exist[100001] = {};
  for (int i = 0; i < m; i++) {
    cin >> x;
    cnt[x]++;
    exist[cnt[x]]++;
    if (exist[k] == n)
      cout << 1, k++;
    else
      cout << 0;
  }
  return 0;
}
