#include <bits/stdc++.h>
using namespace std;
const int N = 200009;
pair<int, int> ans[N];
inline int qr() {
  int x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = (x << 1) + (x << 3) + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
int n, s, a, tot;
priority_queue<pair<int, int> > qs, qt;
int main() {
  n = qr(), s = qr();
  for (register int i = 1; i <= n; i++) {
    a = qr();
    qs.push(make_pair(a, i));
  }
  while (!qs.empty()) {
    pair<int, int> p = qs.top();
    qs.pop();
    while (p.first != 0) {
      if (!qs.size()) {
        puts("No");
        return 0;
      }
      pair<int, int> v = qs.top();
      qs.pop();
      ans[++tot] = make_pair(p.second, v.second);
      p.first--;
      v.first--;
      if (v.first) qt.push(v);
    }
    while (!qt.empty()) {
      qs.push(qt.top());
      qt.pop();
    }
  }
  puts("Yes");
  printf("%d\n", tot);
  for (register int i = 1; i <= tot; i++)
    printf("%d %d\n", ans[i].first, ans[i].second);
  return 0;
}
