#include <bits/stdc++.h>
using namespace std;
struct Node {
  int p, d;
} a[200000];
int ans[100000][2];
priority_queue<Node> q;
bool operator<(Node a, Node b) { return a.d < b.d; }
int main() {
  int n, i, s, d;
  Node x;
  scanf("%d%d", &n, &s);
  for (i = 1; i <= n; ++i) {
    scanf("%d", &d);
    if (!d) continue;
    Node x = {i, d};
    q.push(x);
  }
  int k = 0;
  while (!q.empty()) {
    x = q.top();
    q.pop();
    if (x.d > q.size()) {
      printf("No\n");
      return 0;
    }
    for (i = 0; i < x.d; ++i) a[i] = q.top(), q.pop();
    for (i = 0; i < x.d; ++i) {
      ans[k][0] = x.p, ans[k][1] = a[i].p, ++k;
      if (--a[i].d) q.push(a[i]);
    }
  }
  printf("Yes\n%d\n", k);
  while (k--) printf("%d %d\n", ans[k][0], ans[k][1]);
  return 0;
}
