#include <bits/stdc++.h>
using namespace std;
const long long MAX = 1000001;
long long inf = 1000000000;
long long n, m, mus = 0;
long long used[MAX], sz[MAX], l[MAX];
vector<long long> tmp;
vector<long long> kek;
vector<long long> link[MAX];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> l[i + 1];
    if (l[i + 1] == 1)
      kek.push_back(i + 1);
    else
      tmp.push_back(i + 1);
  }
  long long st = -1;
  if (kek.size()) {
    st = kek.back();
    kek.pop_back();
  }
  if (kek.size()) {
    tmp.push_back(kek.back());
    kek.pop_back();
  }
  for (int i = 0; i < tmp.size(); i++) {
    for (int j = 0; j < l[tmp[i]] - 2; j++) {
      if (kek.size()) {
        link[tmp[i]].push_back(kek.back());
        kek.pop_back();
      }
    }
  }
  if (kek.size()) {
    cout << "NO\n";
    return 0;
  }
  cout << "YES\n";
  cout << tmp.size() + (st != -1) - 1 << "\n";
  vector<pair<long long, long long>> ans;
  if (st != -1) ans.push_back({st, tmp[0]});
  for (int i = 0; i < tmp.size(); i++) {
    for (auto j : link[tmp[i]]) {
      ans.push_back({j, tmp[i]});
    }
    if (i != 0) ans.push_back({tmp[i], tmp[i - 1]});
  }
  cout << ans.size() << "\n";
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i].first << " " << ans[i].second << "\n";
  }
  return 0;
}
