#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
int n, s;
set<pii, greater<pii>> h;
vector<pii> sol;
void EXEC() {
  scanf("%d%d", &n, &s);
  for (int i = 1; i <= n; ++i) {
    int t;
    scanf("%d", &t);
    h.insert({t, i});
  }
  for (int i = 1; i <= n; ++i) {
    pii x = *h.rbegin();
    h.erase(x);
    vector<pii> t;
    while (x.first--) {
      if (h.empty() || h.begin()->first == 0) {
        printf("No\n");
        return;
      }
      t.push_back(*h.begin());
      h.erase(h.begin());
    }
    for (auto &j : t) {
      sol.push_back({x.second, j.second});
      --j.first;
      h.insert(j);
    }
  }
  printf("Yes\n");
  printf("%d\n", int(sol.size()));
  for (auto &i : sol) printf("%d %d\n", i.first, i.second);
}
int main() {
  EXEC();
  return 0;
}
