#include <bits/stdc++.h>
using namespace std;
int read() {
  int f = 1, x = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -f;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return f * x;
}
int n, m, a[100005], cnt = 0;
int vis[100005] = {0};
void init() {
  n = read(), m = read();
  for (int i = 1; i <= m; ++i) a[i] = read();
}
void solve() {
  for (int i = 1; i <= m; ++i) {
    if (!vis[a[i]]) cnt++;
    vis[a[i]]++;
    if (cnt == n) {
      putchar('1'), cnt = 0;
      for (int j = 1; j <= n; ++j) {
        vis[j]--;
        if (vis[j]) cnt++;
      }
    } else
      putchar('0');
  }
}
int main() {
  init();
  solve();
  return 0;
}
