#include <bits/stdc++.h>
using namespace std;
const int N = 1000010;
struct node {
  int w, i;
  void init(int x) {
    i = x;
    scanf("%d", &w);
  }
  node(int a, int b) { w = a, i = b; }
  node() {}
  friend bool operator<(node n1, node n2) { return n1.w < n2.w; }
} da, tmp[N];
int ans1[N], ans2[N];
int main() {
  int n, s;
  scanf("%d%d", &n, &s);
  priority_queue<node> q;
  for (int i = 1; i <= n; ++i) {
    da.init(i);
    if (da.w > 0) q.push(da);
  }
  int end = 0;
  while (!q.empty()) {
    int i = q.top().i, w = q.top().w;
    q.pop();
    int tl = 0;
    while (w--) {
      if (q.empty()) {
        puts("No");
        return 0;
      }
      tmp[++tl] = node(q.top().w - 1, q.top().i);
      ans1[++end] = i;
      ans2[end] = q.top().i;
      q.pop();
    }
    for (int j = 1; j <= tl; ++j)
      if (tmp[j].w > 0) q.push(tmp[j]);
  }
  puts("Yes");
  printf("%d\n", end);
  for (int i = 1; i <= end; ++i) printf("%d %d\n", ans1[i], ans2[i]);
  return 0;
}
