#include <bits/stdc++.h>
using namespace std;
map<int, int> M, N;
int n, m;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1, t; i <= m; i++) {
    scanf("%d", &t);
    M[t]++;
    if (M.size() == n) {
      for (auto x : M)
        if (x.second > 1) N[x.first] = x.second - 1;
      M = N;
      N.clear();
      putchar('1');
    } else
      putchar('0');
  }
  return 0;
}
