#include <bits/stdc++.h>
using namespace std;
int n, s, i, j, k, l, x, y;
int a[200010];
struct node {
  int i;
};
bool operator<(node x, node y) { return a[x.i] < a[y.i]; }
multiset<node> S;
multiset<node>::iterator p, p2;
int li[200010];
vector<pair<int, int> > v;
int main() {
  scanf("%d%d", &n, &s);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) S.insert((node){i});
  while (!S.empty()) {
    if (a[(*S.begin()).i] == 0) {
      S.erase(S.begin());
      continue;
    }
    p = --S.end();
    x = (*p).i;
    S.erase(p);
    for (li[0] = 0; a[x]; a[x]--)
      if (S.empty())
        return puts("No"), 0;
      else {
        p2 = --S.end();
        y = (*p2).i;
        S.erase(p2);
        li[++li[0]] = y;
        a[y]--;
        v.push_back(make_pair(x, y));
      }
    for (; li[0]; li[0]--) S.insert((node){li[li[0]]});
  }
  if (S.empty()) {
    printf("Yes\n");
    printf("%d\n", s / 2);
    for (int k = 0; k < v.size(); k++)
      printf("%d %d\n", v[k].first, v[k].second);
  } else
    printf("No\n");
  scanf("\n");
  return 0;
}
