#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 5;
int n, m;
int num[500005];
int minv[maxn << 2], cur[maxn << 2];
void push_ud(int rt) { minv[rt] = min(minv[rt << 1], minv[rt << 1 | 1]); }
void push_dd(int l, int r, int rt) {
  if (cur[rt]) {
    int mid = (l + r) >> 1;
    cur[rt << 1] += cur[rt];
    cur[rt << 1 | 1] += cur[rt];
    minv[rt << 1] += cur[rt];
    minv[rt << 1 | 1] += cur[rt];
    cur[rt] = 0;
  }
}
void afsdf(int L, int R, int v, int l, int r, int rt) {
  int mid = (l + r) >> 1;
  if (L <= l && R >= r) {
    cur[rt] += v;
    minv[rt] += v;
    return;
  }
  push_dd(l, r, rt);
  if (L <= mid) afsdf(L, R, v, l, mid, rt << 1);
  if (R > mid) afsdf(L, R, v, mid + 1, r, rt << 1 | 1);
  push_ud(rt);
}
int dfsgfg(int L, int R, int l, int r, int rt) {
  if (L <= l && R >= r) {
    return minv[rt];
  }
  int mid = (l + r) >> 1;
  int ret = 0x3f3f3f3f;
  push_dd(l, r, rt);
  if (L <= mid) ret = min(ret, dfsgfg(L, R, l, mid, rt << 1));
  if (R > mid) ret = min(ret, dfsgfg(L, R, mid + 1, r, rt << 1 | 1));
  return ret;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) scanf("%d", num + i);
  for (int i = 1; i <= m; i++) {
    afsdf(num[i], num[i], 1, 1, n, 1);
    if (dfsgfg(1, n, 1, n, 1) >= 1) {
      printf("1");
      afsdf(1, n, -1, 1, n, 1);
    } else {
      printf("0");
    }
  }
  return 0;
}
