#include <bits/stdc++.h>
using namespace std;
int N, M, k, aux = 1, cnt[100005], B[100005];
int main() {
  cin >> N >> M;
  for (int i = 0; i < M; i++) {
    cin >> k;
    B[k]++;
    cnt[B[k]]++;
    if (cnt[aux] == N) {
      aux++;
      cout << "1";
    } else
      cout << "0";
  }
  cout << "\n";
  return 0;
}
