#include <bits/stdc++.h>
using namespace std;
int fre[100010], Rounds[100010];
int main() {
  int n, m, a;
  scanf("%d%d", &n, &m);
  while (m--) {
    scanf("%d", &a);
    fre[a]++;
    Rounds[fre[a]]++;
    if (Rounds[fre[a]] == n)
      printf("1");
    else
      printf("0");
  }
  printf("\n");
  return 0;
}
