#include <bits/stdc++.h>
using namespace std;
set<pair<int, int> > a;
vector<pair<int, int> > res;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    int val;
    scanf("%d", &val);
    a.insert(make_pair(val, i + 1));
  }
  for (int i = n - 1; i >= 0; i--) {
    pair<int, int> cnt = *a.rbegin();
    a.erase(cnt);
    if (cnt.first > i) {
      puts("No");
      return 0;
    }
    if (cnt.first < 0) {
      puts("No");
      return 0;
    }
    vector<pair<int, int> > c;
    for (int j = 0; j < cnt.first; j++) {
      pair<int, int> ret = *a.rbegin();
      a.erase(ret);
      res.push_back(make_pair(cnt.second, ret.second));
      ret.first--;
      c.push_back(ret);
    }
    for (int j = 0; j < c.size(); j++) a.insert(c[j]);
  }
  puts("Yes");
  printf("%lu\n", res.size());
  for (int i = 0; i < res.size(); i++)
    printf("%d %d\n", res[i].first, res[i].second);
  return 0;
}
