#include <bits/stdc++.h>
using namespace ::std;
const long double PI = acos(-1);
const long long MOD = 1000000000 + 7;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long add(long long a, long long b, long long m = MOD) {
  if (a >= m) a %= m;
  if (b >= m) b %= m;
  if (a < 0) a += m;
  if (b < 0) b += m;
  long long res = a + b;
  if (res >= m or res <= -m) res %= m;
  if (res < 0) res += m;
  return res;
}
long long mul(long long a, long long b, long long m = MOD) {
  if (a >= m) a %= m;
  if (b >= m) b %= m;
  if (a < 0) a += m;
  if (b < 0) b += m;
  long long res = a * b;
  if (res >= m or res <= -m) res %= m;
  if (res < 0) res += m;
  return res;
}
long long pow_mod(long long a, long long b, long long m = MOD) {
  long long res = 1LL;
  a = a % m;
  while (b) {
    if (b & 1) res = mul(res, a, m);
    b >>= 1;
    a = mul(a, a, m);
  }
  return res;
}
long long fastexp(long long a, long long b) {
  long long res = 1LL;
  while (b) {
    if (b & 1) {
      res = res * a;
    }
    b >>= 1;
    a *= a;
  }
  return res;
}
int gcdExtendido(int a, int b, int *x, int *y) {
  if (a == 0) {
    *x = 0;
    *y = 1;
    return b;
  }
  int x1, y1;
  int gcd = gcdExtendido(b % a, a, &x1, &y1);
  *x = y1 - (b / a) * x1;
  *y = x1;
  return gcd;
}
int modInverso(int a, int m) {
  int x, y;
  int g = gcdExtendido(a, m, &x, &y);
  if (g != 1)
    return -1;
  else
    return (x % m + m) % m;
}
const int N = 1000 + 5;
const int SUML = 1000000 + 5;
int n;
int a[N];
int id[SUML];
int nodes = 1;
string ans[N];
int trie[SUML][3];
bool blocked[SUML];
bool insert(int len, int p) {
  int pos = 0;
  vector<int> positions;
  for (int i = 0; i < len; i++) {
    int nxt = 0;
    if (trie[pos][nxt] and (id[trie[pos][nxt]] or blocked[trie[pos][nxt]]))
      nxt = 1;
    if (trie[pos][nxt] and (id[trie[pos][nxt]] or blocked[trie[pos][nxt]])) {
      return false;
    }
    if (trie[pos][nxt] == 0) trie[pos][nxt] = nodes++;
    positions.emplace_back(pos);
    pos = trie[pos][nxt];
  }
  id[pos] = p;
  blocked[pos] = true;
  for (int i = positions.size() - 1; i >= 0; i--) {
    int x = positions[i];
    if (trie[x][0] and trie[x][1] and blocked[trie[x][0]] and
        blocked[trie[x][1]]) {
      blocked[x] = true;
    }
  }
  return true;
}
void DFS(int u, string &s) {
  if (id[u]) {
    ans[id[u]] = s;
  }
  for (int i = 0; i < 2; i++) {
    if (trie[u][i]) {
      s.push_back('0' + i);
      DFS(trie[u][i], s);
      s.pop_back();
    }
  }
}
int main() {
  scanf("%d", &(n));
  vector<int> p(n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &(a[i]));
    p[i - 1] = i;
  }
  sort((p).begin(), (p).end(), [&](int i, int j) { return a[i] < a[j]; });
  bool can = true;
  for (auto x : p) {
    if (!insert(a[x], x)) {
      can = false;
    }
  }
  if (!can) {
    puts("NO");
    return 0;
  }
  string s = "";
  DFS(0, s);
  puts("YES");
  for (int i = 1; i <= n; i++) {
    printf("%s\n", ans[i].c_str());
  }
  return 0;
}
