#include <bits/stdc++.h>
using namespace std;
int n, arr[1005], ans[1005], temp[1005], rel[1005][1005];
struct node {
  int l, r;
  bool is;
} tree[500000];
int len, root;
bool ok;
void dfs(int u, int cen, int ll, bool bb) {
  if (ok || tree[u].is) return;
  if (cen == 0) {
    if (!bb) return;
    ok = 1;
    tree[u].is = 1;
    int i;
    for (i = 1; i <= ll; i++) temp[i] = ans[i];
    return;
  }
  ans[cen] = 0;
  if (tree[u].l >= 0) {
    dfs(tree[u].l, cen - 1, ll, bb);
  } else {
    tree[len].l = tree[len].r = -1;
    tree[len].is = 0;
    tree[u].l = len++;
    dfs(tree[u].l, cen - 1, ll, 1);
  }
  if (ok) return;
  ans[cen] = 1;
  if (tree[u].r >= 0) {
    dfs(tree[u].r, cen - 1, ll, bb);
  } else {
    tree[len].l = tree[len].r = -1;
    tree[len].is = 0;
    tree[u].r = len++;
    dfs(tree[u].r, cen - 1, ll, 1);
  }
}
int main() {
  scanf("%d", &n);
  int i, j;
  for (i = 0; i < n; i++) scanf("%d", arr + i);
  tree[0].l = tree[0].r = -1;
  tree[0].is = 0;
  len++;
  for (i = 0; i < n; i++) {
    ok = 0;
    dfs(root, arr[i], arr[i], 0);
    if (ok == 0) {
      puts("NO");
      return 0;
    }
    for (j = arr[i]; j > 0; j--) rel[i][j] = temp[j];
  }
  puts("YES");
  for (i = 0; i < n; i++) {
    for (j = arr[i]; j > 0; j--) printf("%d", rel[i][j]);
    puts("");
  }
  return 0;
}
