#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void amin(T &x, const T &y) {
  if (y < x) x = y;
}
template <class T>
inline void amax(T &x, const T &y) {
  if (x < y) x = y;
}
template <class Iter>
void rprintf(const char *fmt, Iter begin, Iter end) {
  for (bool sp = 0; begin != end; ++begin) {
    if (sp)
      putchar(' ');
    else
      sp = true;
    printf(fmt, *begin);
  }
  putchar('\n');
}
int N, M;
int A[100011];
int pool[100011];
void MAIN() {
  scanf("%d%d", &N, &M);
  for (int i = 0, i_len = (M); i < i_len; ++i) scanf("%d", A + i), A[i]--;
  int cnt = 0;
  for (int i = 0, i_len = (M); i < i_len; ++i) {
    if (pool[A[i]] == 0) cnt++;
    pool[A[i]]++;
    if (cnt == N) {
      putchar('1');
      for (int j = 0, j_len = (N); j < j_len; ++j) {
        if (pool[j] == 1) cnt--;
        pool[j]--;
      }
    } else {
      putchar('0');
    }
  }
  putchar('\n');
}
int main() {
  int TC = 1;
  for (int tc = 0, tc_len = (TC); tc < tc_len; ++tc) MAIN();
  return 0;
}
