#include <bits/stdc++.h>
using namespace std;
int hat[200000];
priority_queue<pair<int, int> > qu;
vector<pair<int, int> > sw;
int main() {
  int N, S;
  scanf("%d %d", &N, &S);
  for (int i = 0; i < N; i++) {
    scanf("%d", &hat[i]);
    qu.push(pair<int, int>(hat[i], i));
  }
  while (!qu.empty()) {
    int a = qu.top().second;
    qu.pop();
    vector<int> hier;
    for (int k = 0; k < hat[a]; k++) {
      if (qu.empty()) {
        printf("No\n");
        return 0;
      }
      int b = qu.top().second;
      qu.pop();
      if (hat[b] == 0) {
        printf("No\n");
        return 0;
      }
      hat[b]--;
      hier.push_back(b);
      sw.push_back(pair<int, int>(a, b));
    }
    for (typeof((hier).begin()) b = (hier).begin(); b != (hier).end(); b++)
      qu.push(pair<int, int>(hat[*b], *b));
  }
  printf("Yes\n%d\n", S / 2);
  for (typeof((sw).begin()) i = (sw).begin(); i != (sw).end(); i++)
    printf("%d %d\n", i->first + 1, i->second + 1);
  return 0;
}
