#include <bits/stdc++.h>
using namespace std;
pair<int, int> d[200001];
int n, m, s, sz;
int main() {
  scanf("%d%d", &n, &s);
  for (int i = 0; i < n; i++) {
    int tmp;
    scanf("%d", &tmp);
    d[i] = pair<int, int>(tmp, i + 1);
  }
  vector<pair<int, int> > ans;
  priority_queue<pair<int, int> > q;
  for (int i = 0; i < n; i++) q.push(d[i]);
  while (q.top().first) {
    pair<int, int> cur = q.top();
    q.pop();
    sz = 0;
    for (int i = 0; i < cur.first; i++) {
      if (q.empty()) {
        puts("No");
        return 0;
      }
      d[sz++] = q.top();
      q.pop();
    }
    for (int i = 0; i < sz; i++) {
      if (d[i].first-- == 0) {
        puts("No");
        return 0;
      }
      ans.push_back(pair<int, int>(cur.second, d[i].second));
      q.push(d[i]);
    }
  }
  puts("Yes");
  printf("%d\n", ans.size());
  for (int i = 0; i < s / 2; i++)
    printf("%d %d\n", ans[i].first, ans[i].second);
  return 0;
}
