#include <bits/stdc++.h>
using namespace std;
set<pair<int, int> > nic;
vector<pair<int, int> > tmp;
void nastepny(int &a, int &w) {
  if (nic.empty()) {
    a = w = 0;
    return;
  }
  pair<int, int> x = *nic.begin();
  nic.erase(nic.begin());
  a = -x.first;
  w = x.second;
}
vector<pair<int, int> > wynik;
int main() {
  int n, s;
  scanf("%d%d", &n, &s);
  for (int i = 1; i <= n; i++) {
    int a;
    scanf("%d", &a);
    nic.insert(make_pair(-a, i));
  }
  while (true) {
    int a, w;
    nastepny(a, w);
    if (a == 0) break;
    while (a--) {
      int b, v;
      nastepny(b, v);
      if (b == 0) {
        printf("No\n");
        return 0;
      }
      wynik.push_back(make_pair(w, v));
      tmp.push_back(make_pair(-(b - 1), v));
    }
    for (int i = 0; i < tmp.size(); i++) nic.insert(tmp[i]);
    tmp.clear();
  }
  printf("Yes\n");
  printf("%d\n", (int)wynik.size());
  for (int i = 0; i < wynik.size(); i++)
    printf("%d %d\n", wynik[i].first, wynik[i].second);
  return 0;
}
