#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 6;
int a[MAX], cnt[MAX];
int size[MAX];
int n, m;
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> a[i];
    cnt[a[i]]++;
    size[cnt[a[i]]]++;
    if (size[cnt[a[i]]] == n)
      cout << 1;
    else
      cout << 0;
  }
}
