#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
const double PI = acos(-1.0);
const double eps = 1e-9;
const long long MOD = 1e9 + 7;
const long long INF = 1e18 + 7;
const long long MAXN = 1e6 + 7;
long long t, n, m, ans, cnt, f[MAXN], g[MAXN];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long i, j, k, l;
  cin >> n >> m;
  for (i = 1; i <= m; i++) {
    cin >> t;
    if (!f[t]) cnt++;
    f[t]++;
    if (cnt == n) {
      cnt = 0, g[i] = 1;
      for (j = 1; j <= n; j++) f[j]--, cnt += f[j] > 0;
    }
    cout << g[i];
  }
  return 0;
}
