#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a[100001] = {0}, b[100001] = {0};
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    a[x]++;
    b[a[x]]++;
    if (b[a[x]] == n)
      cout << 1;
    else
      cout << 0;
  }
  return 0;
}
