#include <bits/stdc++.h>
using namespace std;
const int SIZE = 1e6;
const long long INF = 9223372036854775800;
const long long inf = 2147483640;
const long double pi = 3.141595153589793;
const long long M = inf;
long long st[SIZE];
void ST(int a, int cnt) {
  st[0] = 1;
  for (int i = 1; i <= cnt; i++) {
    st[i] = (st[i - 1] * a) % M;
  }
}
long long f[SIZE];
void FCT(int cnt) {
  f[0] = 1;
  for (int i = 1; i <= cnt; i++) {
    f[i] = (f[i - 1] * i) % M;
  }
}
int z[SIZE];
void Z(string s) {
  z[0] = 0;
  int n = s.size();
  int l = 0, r = 0;
  for (int i = 1; i < n; i++) {
    z[i] = max(0, min(z[i - l], r - i));
    while (z[i] + i < n && s[z[i]] == s[z[i] + i]) z[i]++;
    if (z[i] + i > r) {
      l = i;
      r = i + z[i];
    }
  }
}
long long pow(long long a, long long b) {
  if (!b) return 1;
  if (b % 2 == 1) {
    long long res = pow(a, b - 1);
    return (a * res) % M;
  } else {
    long long res = pow(a, b / 2);
    return (res * res) % M;
  }
}
long long gsd(long long a, long long b) {
  if (!b) return a;
  return gsd(b, a % b);
}
long long to_num(string num) {
  int n = 0;
  int c = 1;
  for (int i = num.size() - 1; i >= 0; i--) {
    n += c * ((int)num[i] - (int)'0');
    c *= 10;
  }
  return n;
}
int cnt[100005];
void solve() {
  int n, m;
  cin >> n >> m;
  int made = 0;
  vector<int> ans;
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    cnt[--x]++;
    if (cnt[x] == 1) made++;
    if (made == n) {
      ans.push_back(1);
      for (int i = 0; i < n; i++) {
        cnt[i]--;
        if (!cnt[i]) made--;
      }
    } else
      ans.push_back(0);
  }
  for (int i = 0; i < m; i++) {
    cout << ans[i];
  }
  cout << '\n';
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) solve();
}
