#include <bits/stdc++.h>
using namespace std;
const int N = 200000 + 10;
const int inf = 0x3f3f3f3f;
int m, n, a[N];
struct Node {
  int val;
  int id;
  bool operator<(Node a) const { return val < a.val; }
} node[N];
struct no {
  int x, y;
} ans[N];
int main() {
  int x;
  Node st, ed;
  priority_queue<Node> q;
  while (~scanf("%d%d", &m, &n)) {
    int tag = 1;
    while (!q.empty()) q.pop();
    for (int i = 1; i <= m; ++i) {
      scanf("%d", &x);
      if (x >= m) tag = 0;
      st.val = x;
      st.id = i;
      if (st.val > 0) q.push(st);
    }
    if (!tag || n % 2) {
      printf("No\n");
      continue;
    }
    int cnt = 0;
    for (int i = 1;; ++i) {
      if (q.empty()) break;
      st = q.top();
      q.pop();
      if (q.size() < st.val) {
        tag = 0;
        break;
      }
      for (int j = 0; j < st.val; ++j) {
        ed = q.top();
        q.pop();
        node[j].id = ed.id;
        node[j].val = ed.val;
        node[j].val--;
        ans[cnt].x = st.id;
        ans[cnt++].y = node[j].id;
      }
      for (int j = 0; j < st.val; ++j)
        if (node[j].val > 0) q.push(node[j]);
    }
    if (!tag) {
      puts("No");
      continue;
    }
    puts("Yes");
    printf("%d\n", n / 2);
    for (int i = 0; i < cnt; ++i) printf("%d %d\n", ans[i].x, ans[i].y);
  }
  return 0;
}
