#include <bits/stdc++.h>
using namespace std;
const long long N = (long long)2e5 + 77;
const long long inf = (long long)1e18 + 77;
const long long mod = (long long)1e9 + 7;
const long double pi = acos(-1);
int n, m, k, a[N], b[N];
set<int> ss;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> m;
  for (int i = 0; i < (int)m; i++) cin >> a[i];
  for (int i = 0; i < (int)m; i++) {
    ++b[a[i]];
    ss.insert(a[i]);
    if ((int)ss.size() == n) {
      cout << "1";
      for (int j = 1; j <= (int)n; j++) {
        --b[j];
        if (b[j] == 0) ss.erase(j);
      }
    } else
      cout << "0";
  }
  return 0;
}
