#include <bits/stdc++.h>
using namespace std;
int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1};
int dy8[] = {1, -1, 1, -1, 0, 0, -1, 1};
const double PI = acos(-1.0);
const double EPS = 1e-6;
const int MOD = (int)1e9 + 7;
const int maxn = (int)2e5 + 5;
int cnt[maxn];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m, i, j;
  cin >> n >> m;
  set<int> s;
  for (i = 1; i <= (m); i++) {
    int x;
    cin >> x;
    cnt[x]++;
    s.insert(x);
    if ((int)s.size() == n) {
      cout << "1";
      for (j = 1; j <= (n); j++) {
        cnt[j]--;
        if (cnt[j] == 0) s.erase(j);
      }
    } else
      cout << "0";
  }
}
