#include <bits/stdc++.h>
using namespace std;
int d[201000], n, m;
vector<pair<int, int> > pr;
priority_queue<pair<int, int> > q;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d", &d[i]);
  for (int i = 1; i <= n; i++)
    if (d[i] > 0) q.push(make_pair(d[i], i));
  for (int i = n; i >= 1; i--) {
    if (q.empty()) break;
    pair<int, int> tmp = q.top();
    int p = tmp.second, times = tmp.first;
    q.pop();
    vector<int> vt;
    while (times--) {
      if (q.empty()) {
        printf("No\n");
        return 0;
      }
      int pa = q.top().second;
      q.pop();
      d[pa]--;
      pr.push_back(make_pair(p, pa));
      if (d[pa]) vt.push_back(pa);
    }
    for (int i = 0; i < vt.size(); i++) q.push(make_pair(d[vt[i]], vt[i]));
  }
  printf("Yes\n");
  printf("%d\n", pr.size());
  for (int i = 0; i < pr.size(); i++) {
    printf("%d %d\n", pr[i].first, pr[i].second);
  }
  return 0;
}
