#include <bits/stdc++.h>
using namespace std;
int i, x, y, n, iCount, s, a[200009], b[200009], result1[200009],
    result2[200009];
struct compare {
  bool operator()(int x, int y) {
    if (a[x] != a[y]) return a[x] > a[y];
    if (x != y) return x > y;
    return false;
  }
};
set<int, compare> q;
int main() {
  scanf("%d%d", &n, &s);
  for (i = 1; i <= n; ++i) scanf("%d", &a[i]);
  for (i = 1; i <= n; ++i)
    if (a[i] != 0) q.insert(i);
  iCount = 0;
  while (!q.empty()) {
    x = *q.begin();
    q.erase(q.begin());
    b[0] = 0;
    for (i = 0; i < a[x]; ++i)
      if (q.empty()) {
        iCount = -1;
        break;
      } else {
        y = *q.begin();
        q.erase(q.begin());
        b[++b[0]] = y;
        --a[y];
        result1[++iCount] = x;
        result2[iCount] = y;
      }
    if (iCount == -1) break;
    for (i = 1; i <= b[0]; ++i)
      if (a[b[i]] != 0) q.insert(b[i]);
  }
  if (iCount == -1)
    cout << "No" << endl;
  else {
    cout << "Yes" << endl;
    printf("%d\n", iCount);
    for (i = 1; i <= iCount; ++i) printf("%d %d\n", result1[i], result2[i]);
  }
  return 0;
}
