#include <bits/stdc++.h>
using namespace std;
int deg[200005];
vector<int> a[200005];
int main(void) {
  int n, s;
  scanf("%d%d", &n, &s);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &deg[i]);
    if (deg[i] >= n) {
      puts("No");
      return 0;
    }
    a[deg[i]].push_back(i);
  }
  vector<pair<int, int> > ans;
  for (int i = n; i >= 1; --i) {
    while (!a[i].empty()) {
      int v = a[i].back();
      a[i].pop_back();
      int r = i;
      vector<pair<int, int> > wait;
      for (int j = i; r > 0 && j >= 1; --j) {
        while (r > 0 && !a[j].empty()) {
          int w = a[j].back();
          a[j].pop_back();
          ans.push_back(make_pair(v, w));
          wait.push_back(make_pair(j - 1, w));
          --r;
        }
      }
      if (r) {
        puts("No");
        return 0;
      }
      for (int t = 0; t < (int)wait.size(); t++)
        a[wait[t].first].push_back(wait[t].second);
    }
  }
  puts("Yes");
  printf("%d\n", (int)ans.size());
  for (int i = 0; i < (int)ans.size(); i++)
    printf("%d %d\n", ans[i].first, ans[i].second);
  return 0;
}
