#include <bits/stdc++.h>
using namespace std;
int n, m, n1;
int cur[100010];
set<int> s[100010];
int main() {
  scanf("%d %d", &n, &m);
  for (int g = 1; g <= n; g++) {
    s[0].insert(g);
    cur[g] = 0;
  }
  int last = 0;
  for (int g = 0; g < m; g++) {
    scanf("%d", &n1);
    s[cur[n1]].erase(n1);
    cur[n1]++;
    s[cur[n1]].insert(n1);
    if (s[last].size() == 0)
      printf("1"), last++;
    else
      printf("0");
  }
}
