#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long dx[4] = {-1, 1, 0, 0};
const long long dy[4] = {0, 0, -1, 1};
const long long MAX = 2e5 + 10;
long long gcd(long long a, long long b) { return (b == 0 ? a : gcd(b, a % b)); }
long long n, m, k, Q, l, x, y, ans;
string second;
vector<int> v;
int cnt[MAX];
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  int rounds = 0;
  set<pair<int, int> > st;
  for (int i = 0; i < n; ++i) st.insert({0, i});
  for (int i = 0; i < k; ++i) {
    cin >> x;
    --x;
    st.erase({cnt[x], x});
    cnt[x]++;
    st.insert({cnt[x], x});
    auto u = *st.begin();
    if (u.first > rounds)
      rounds++, cout << 1;
    else
      cout << 0;
  }
}
