#include <bits/stdc++.h>
using namespace std;
struct cosa {
  int idx, cnt;
  cosa() {}
  cosa(int n1, int n2) {
    idx = n1;
    cnt = n2;
  }
};
bool operator<(cosa a, cosa b) {
  if (a.cnt != b.cnt)
    return a.cnt > b.cnt;
  else
    return a.idx < b.idx;
}
int main() {
  int n, s;
  while (cin >> n >> s) {
    set<cosa> S;
    for (int i = 0; i < n; i++) {
      int k;
      cin >> k;
      if (k != 0) S.insert(cosa(i, k));
    }
    set<cosa>::iterator first, it;
    vector<pair<int, int> > x;
    vector<cosa> v;
    bool ok = 1;
    while (S.size() > 0) {
      it = S.begin();
      int ind = (*it).idx, cnt = (*it).cnt;
      S.erase(*it);
      v.clear();
      for (int i = 0; i < cnt; i++) {
        if (S.size() == 0) {
          ok = 0;
          break;
        } else {
          it = S.begin();
          x.push_back(make_pair(ind + 1, (*it).idx + 1));
          v.push_back(*it);
          S.erase(*it);
        }
      }
      if (!ok) break;
      for (int i = 0; i < v.size(); i++)
        if (v[i].cnt > 1) S.insert(cosa(v[i].idx, v[i].cnt - 1));
    }
    if (!ok)
      cout << "No" << endl;
    else {
      cout << "Yes" << endl;
      cout << x.size() << endl;
      for (int i = 0; i < x.size(); i++)
        cout << x[i].first << " " << x[i].second << endl;
    }
  }
  return 0;
}
