#include <bits/stdc++.h>
using namespace std;
struct node {
  int d, num;
} tmp;
bool operator<(node a1, node a2) { return a1.d < a2.d; };
bool operator>(node a1, node a2) { return a1.d > a2.d; }
bool operator==(node a1, node a2) { return a1.d == a2.d; }
int n, s;
priority_queue<node> Q[2];
vector<int> adj[200100];
void init() {
  cin >> n >> s;
  for (int i = 1; i <= n; i++) {
    cin >> tmp.d;
    tmp.num = i;
    if (tmp.d) Q[0].push(tmp);
  }
}
void solve() {
  int ind = 0;
  node t, newt;
  string da = "Yes", ne = "No";
  while (!Q[ind].empty()) {
    tmp = Q[ind].top();
    Q[ind].pop();
    if (tmp.d > Q[ind].size()) {
      cout << ne << endl;
      return;
    }
    for (int i = 1; i <= tmp.d; i++) {
      t = newt = Q[ind].top();
      Q[ind].pop();
      newt.d--;
      if (newt.d) Q[1 - ind].push(newt);
      adj[tmp.num].push_back(t.num);
    }
    while (!Q[1 - ind].empty()) {
      t = Q[1 - ind].top();
      Q[1 - ind].pop();
      Q[ind].push(t);
    }
  }
  cout << da << endl << s / 2 << endl;
  for (int i = 1; i <= n; i++) {
    if (!adj[i].size()) continue;
    for (int j = 0; j <= adj[i].size() - 1; j++)
      cout << i << " " << adj[i][j] << endl;
  }
}
int main() {
  init();
  solve();
  return 0;
}
