#include <bits/stdc++.h>
int inp() {
  char c = getchar();
  int neg = 1;
  while (c < '0' || c > '9') {
    if (c == '-') neg = -1;
    c = getchar();
  }
  int sum = 0;
  while (c >= '0' && c <= '9') {
    sum = sum * 10 + c - '0';
    c = getchar();
  }
  return sum * neg;
}
struct Node {
  int x;
  int res;
} s[1000];
int head[1000];
int nxt[2010];
int end[2010];
int cou = 0;
int dis[1000];
int d[1000];
void link(int a, int b) {
  nxt[++cou] = head[a];
  head[a] = cou;
  end[cou] = b;
}
void dfs(int cur, int last) {
  for (int x = head[cur]; x != -1; x = nxt[x]) {
    if (end[x] == last) continue;
    dis[end[x]] = dis[cur] + 1;
    dfs(end[x], cur);
  }
}
int main() {
  memset(head, -1, sizeof(head));
  int n = inp();
  for (int i = 1; i <= n; i++) {
    d[i] = inp();
    if (d[i] == 0) {
      printf("NO");
      return 0;
    }
  }
  int c = 0;
  for (int i = 1; i <= n; i++) {
    if (d[i] >= 2) s[++c] = (Node){i, d[i] - 2};
  }
  if (c == 0) {
    printf("NO");
    return 0;
  }
  int cur = 1;
  s[1].res++;
  s[c].res++;
  bool flg = false;
  for (int i = 1; i <= n; i++) {
    if (d[i] < 2) {
      if (!flg) {
        link(i, s[c].x);
        link(s[c].x, i);
        s[c].res--;
        flg = true;
        continue;
      }
      while (s[cur].res <= 0 && cur <= c) cur++;
      if (cur > c) {
        printf("NO");
        return 0;
      }
      s[cur].res--;
      link(i, s[cur].x);
      link(s[cur].x, i);
    }
  }
  for (int i = 1; i < c; i++) {
    link(s[i].x, s[i + 1].x);
    link(s[i + 1].x, s[i].x);
  }
  dfs(1, -1);
  int max = 0;
  int maxk;
  for (int i = 1; i <= n; i++)
    if (dis[i] > max) {
      max = dis[i];
      maxk = i;
    }
  dis[maxk] = 0;
  dfs(maxk, -1);
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if (dis[i] > ans) ans = dis[i];
  }
  printf("YES %d\n", ans);
  printf("%d\n", n - 1);
  for (int i = 1; i <= n; i++)
    for (int x = head[i]; x != -1; x = nxt[x])
      if (end[x] > i) printf("%d %d\n", i, end[x]);
}
