#include <bits/stdc++.h>
using namespace std;
long n, m;
long a[100001], dem[100001];
vector<int> d[100001];
static int dd[100001];
long sl = 0;
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) cin >> a[i];
  for (int i = 1; i <= m; i++) {
    dem[a[i]]++;
    sl = max(sl, dem[a[i]]);
    d[dem[a[i]]].push_back(i);
  }
  for (int i = 1; i <= sl; i++)
    if (d[i].size() == n) dd[d[i][d[i].size() - 1]] = 1;
  for (int i = 1; i <= m; i++) cout << dd[i];
}
