#include <bits/stdc++.h>
using namespace std;
int n, m;
bool debug = false;
int k;
vector<pair<int, int>> ans;
vector<int> v[200055], tmp;
int d[200055];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d", d + i);
    v[d[i]].push_back(i);
  }
  for (int i = m; i > 0; i--) {
    while (!v[i].empty()) {
      int s = v[i].back();
      v[i].pop_back();
      for (int j = i; j; j--) {
        while (d[s] > 0 && !v[j].empty()) {
          int t = v[j].back();
          v[j].pop_back();
          d[s]--;
          d[t]--;
          tmp.push_back(t);
          ans.push_back({s, t});
        }
      }
      if (d[s] > 0) {
        puts("No");
        return 0;
      }
      for (auto x : tmp) v[d[x]].push_back(x);
      tmp.clear();
    }
  }
  puts("Yes");
  printf("%d\n", ans.size());
  for (auto x : ans) printf("%d %d\n", x.first, x.second);
  return 0;
}
