#include <bits/stdc++.h>
using namespace std;
int n, ra[200005], rb[200005], cnt = 0;
int tv[200005], ti[200005];
priority_queue<pair<int, int> > pq;
int main() {
  scanf("%d%*d", &n);
  for (int i = 0; i < n; i++) {
    int c;
    scanf("%d", &c);
    if (c > 0) pq.push(make_pair(c, i + 1));
  }
  int tcnt = 0, tot, ind;
  while (!pq.empty()) {
    tot = pq.top().first;
    ind = pq.top().second;
    tcnt = 0;
    pq.pop();
    for (int i = 0; i < tot; i++) {
      if (pq.empty()) {
        printf("No\n");
        return 0;
      }
      ra[cnt] = ind;
      rb[cnt] = pq.top().second;
      cnt++;
      if (pq.top().first > 1) {
        tv[tcnt] = pq.top().first - 1;
        ti[tcnt] = pq.top().second;
        tcnt++;
      }
      pq.pop();
    }
    for (int i = 0; i < tcnt; i++) pq.push(make_pair(tv[i], ti[i]));
  }
  printf("Yes\n%d\n", cnt);
  for (int i = 0; i < cnt; i++) printf("%d %d\n", ra[i], rb[i]);
}
