#include <bits/stdc++.h>
using namespace std;
const int mxN = 1e5;
const long long MOD = 1e9 + 7;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
int main() {
  fast();
  int n, m;
  cin >> n >> m;
  vector<int> vals(m);
  vector<int> a(n + 1, 0);
  for (int i = 0; i < m; ++i) {
    int x;
    cin >> x;
    vals[i] = x;
    a[x]++;
  }
  int mn = 1e9;
  for (int i = 1; i <= n; ++i) {
    mn = min(mn, a[i]);
  }
  vector<int> done(mn, 0);
  a = vector<int>(n + 1, 0);
  for (int x : vals) {
    bool yes = false;
    a[x]++;
    if (a[x] <= mn) {
      done[a[x] - 1]++;
      if (done[a[x] - 1] == n) {
        yes = true;
      }
    }
    if (yes) {
      cout << 1;
    } else {
      cout << 0;
    }
  }
  cout << "\n";
}
