#include <bits/stdc++.h>
using namespace std;
int main(int argc, char **argv) {
  int n, s;
  scanf("%d%d", &n, &s);
  set<pair<int, int> > a;
  set<pair<int, int> > ans;
  int deg;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &deg);
    a.insert(make_pair(-deg, i + 1));
  }
  bool fl = 1;
  while (a.size()) {
    pair<int, int> cur = *a.begin();
    a.erase(a.begin());
    vector<pair<int, int> > curs;
    set<pair<int, int> >::iterator it = a.begin();
    while (cur.first) {
      if (it == a.end() || !it->first) {
        fl = 0;
        break;
      }
      pair<int, int> ne = make_pair(cur.second, it->second);
      if (!ans.count(ne)) {
        ans.insert(ne);
        cur.first++;
        curs.push_back(*it);
      }
      it++;
    }
    if (!fl) break;
    for (int i = 0; i < curs.size(); ++i) {
      a.erase(curs[i]);
      curs[i].first++;
      a.insert(curs[i]);
    }
  }
  if (fl) {
    printf("Yes\n%d\n", ans.size());
    for (set<pair<int, int> >::iterator it = ans.begin(); it != ans.end();
         it++) {
      printf("%d %d\n", it->first, it->second);
    }
  } else
    printf("No\n");
  return 0;
}
