#include <bits/stdc++.h>
using namespace std;
priority_queue<pair<int, int> > QQ;
int n, total;
vector<pair<int, int> > vec, ans;
int main() {
  int e, num, error, a00, a22, b00, b22;
  while (scanf("%d %d", &n, &total) + 1) {
    ans.clear();
    while (QQ.size()) QQ.pop();
    for (e = 1; e <= n; e++) {
      scanf("%d", &num);
      if (num > 0) QQ.push(make_pair(num, e));
    }
    error = 0;
    while (!error && QQ.size()) {
      a00 = QQ.top().first, a22 = QQ.top().second, QQ.pop();
      vec.clear();
      for (e = 1; e <= a00; e++) {
        if (QQ.size() == 0) {
          error = 1;
          break;
        } else {
          b00 = QQ.top().first, b22 = QQ.top().second, QQ.pop();
          ans.push_back(make_pair(a22, b22));
          if (b00 - 1 > 0) vec.push_back(make_pair(b00 - 1, b22));
        }
      }
      if (error) break;
      for (e = 0; e < (int)vec.size(); e++) QQ.push(vec.at(e));
    }
    printf("%s\n", error ? "No" : "Yes");
    if (!error) {
      printf("%d\n", ans.size());
      if (ans.size())
        for (e = 0; e < (int)ans.size(); e++)
          printf("%d %d\n", ans.at(e).first, ans.at(e).second);
    }
  }
  return 0;
}
