#include <bits/stdc++.h>
using namespace std;
struct comp {
  bool operator()(const int& lhs, const int& rhs) const { return lhs > rhs; }
};
bool f(int a, int b) { return a > b; }
int main() {
  int n, s, k;
  multimap<int, int, comp> mm;
  scanf("%d%d", &n, &s);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &k);
    if (k) mm.insert(make_pair(k, i));
  }
  vector<pair<int, int> > v;
  vector<pair<int, int> > vvv;
  vector<vector<int> > vv;
  while (mm.size() > 0) {
    multimap<int, int>::iterator it = mm.begin();
    if ((*it).first == 0) break;
    int a = (*it).first;
    int aa = (*it).second;
    mm.erase(it);
    for (; a > 0; a--) {
      multimap<int, int>::iterator it = mm.begin();
      if (it == mm.end()) {
        printf("No");
        return 0;
      }
      int b = (*it).first;
      b--;
      vvv.push_back(make_pair(aa, (*it).second));
      if (b) v.push_back(make_pair(b, (*it).second));
      mm.erase(it);
    }
    for (unsigned int i = 0; i < v.size(); i++) mm.insert(v[i]);
    v.clear();
  }
  printf("Yes\n%d\n", (int)vvv.size());
  for (unsigned int i = 0; i < vvv.size(); i++)
    printf("%d %d\n", vvv[i].first, vvv[i].second);
  return 0;
}
