#include <bits/stdc++.h>
using namespace std;
struct stud {
  stud(){};
  stud(int xx, int yy) : x(xx), pos(yy) {}
  int x, pos;
  bool operator<(const stud s) const { return x < s.x; }
} f[200005], b[200005];
int n, s;
vector<pair<int, int> > ans;
priority_queue<stud> q, qq;
bool solve() {
  int i, j;
  ans.clear();
  while (!q.empty()) q.pop();
  while (!qq.empty()) qq.pop();
  for (i = 0; i < n; i++)
    if (f[i].x > 0) q.push(f[i]);
  stud cur;
  while (!q.empty()) {
    cur = q.top();
    q.pop();
    if (cur.x > q.size()) return 0;
    int m = 0;
    while (cur.x--) {
      b[m] = q.top();
      int xx = cur.pos;
      int yy = b[m].pos;
      ans.push_back(make_pair(xx, yy));
      b[m].x--;
      m++;
      q.pop();
    }
    for (i = 0; i < m; i++)
      if (b[i].x) q.push(b[i]);
  }
  return 1;
}
int main() {
  int i, j;
  while (~scanf("%d %d", &n, &s)) {
    for (i = 0; i < n; i++) {
      scanf("%d", &f[i].x);
      f[i].pos = i + 1;
    }
    if (solve()) {
      printf("Yes\n");
      printf("%d\n", ans.size());
      for (i = 0; i < ans.size(); i++) {
        printf("%d %d\n", ans[i].first, ans[i].second);
      }
    } else
      printf("No\n");
  }
  return 0;
}
