#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (!b) return a;
  return gcd(b, a % b);
}
long long fpow(long long a, long long b, long long mod) {
  long long res = 1ll;
  while (b) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return res;
}
long long mul(long long a, long long b, long long mod) {
  long long res = 0;
  while (b) {
    if (b & 1) res = (res + a) % mod;
    a = (a + a) % mod;
    b >>= 1;
  }
  return res;
}
const long long mod = 1e9 + 7;
const double eps = 1e-3;
const double pi = acos(-1);
const long long N = 3e5 + 10;
long long a[N], vis[N], c[N];
int main() {
  long long n, m;
  scanf("%lld %lld", &n, &m);
  long long now = 1;
  for (long long i = 1; i <= m; i++) {
    scanf("%lld", &a[i]);
    vis[a[i]]++;
    c[vis[a[i]]]++;
    if (c[now] == n) {
      putchar('1');
      now++;
    } else
      putchar('0');
  }
  return 0;
}
