#include <bits/stdc++.h>
using namespace std;
const long long Mod = 1e9 + 7;
const double pi = 2 * acos(0.0);
const int N = 1e5 + 5;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  map<int, int> mp;
  for (int i = 0; i < m; i++) {
    int x;
    scanf("%d", &(x));
    mp[x]++;
    if (int((mp).size()) == n) {
      for (auto it = mp.begin(); it != mp.end();) {
        if (it->second == 1) {
          it = mp.erase(it);
        } else
          it->second--, ++it;
      }
      printf("%d", (1));
    } else
      printf("%d", (0));
  }
  return 0;
}
