#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, m, i, j;
  cin >> n >> m;
  long long arr[m];
  for (i = 0; i < m; ++i) cin >> arr[i];
  std::map<long long, long long> map;
  std::map<long long, long long>::iterator it;
  for (i = 0; i < m; ++i) {
    map[arr[i]]++;
    if (map.size() == n) {
      cout << 1;
      for (auto &x : map) {
        x.second--;
      }
      for (it = map.begin(); it != map.end();) {
        if (it->second == 0) {
          map.erase(it++);
        } else
          ++it;
      }
    } else
      cout << 0;
  }
  cout << '\n';
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
