#include <bits/stdc++.h>
using namespace std;
int N, S;
pair<int, int> buf[200002];
int swp[100001][2];
priority_queue<pair<int, int> > Q;
int main() {
  scanf("%d %d", &N, &S);
  for (int i = 0; i < N; ++i) {
    int x;
    scanf("%d", &x);
    Q.push(make_pair(x, i));
  }
  int idx = 0, flag = 1;
  while (!Q.empty() && flag) {
    pair<int, int> cur = Q.top();
    Q.pop();
    int idx1 = 0;
    for (int i = 0; i < cur.first; ++i) {
      if (Q.empty()) {
        flag = 0;
        break;
      }
      pair<int, int> c1 = Q.top();
      Q.pop();
      if (c1.first == 0) {
        flag = 0;
        break;
      }
      c1.first--;
      buf[idx1++] = c1;
      swp[idx][0] = cur.second + 1, swp[idx++][1] = c1.second + 1;
    }
    for (int i = 0; i < idx1; ++i) Q.push(buf[i]);
  }
  if (!flag || idx * 2 != S)
    printf("No\n");
  else {
    printf("Yes\n");
    printf("%d\n", S / 2);
    for (int i = 0; i < idx; ++i) printf("%d %d\n", swp[i][0], swp[i][1]);
  }
  return 0;
}
