#include <bits/stdc++.h>
using namespace std;
const int N = 200100;
int n, all;
int data[N];
int ans;
int cnt;
struct Node {
  int ind;
  int num;
  Node(int index = 0, int number = 0) : ind(index), num(number){};
};
bool operator<(const Node &a, const Node &b) { return a.num < b.num; }
Node rec[N];
pair<int, int> res[N];
priority_queue<Node> pq;
bool deal() {
  int i, j;
  for (i = 0; i < n; i++)
    if (data[i]) pq.push(Node(i + 1, data[i]));
  while (!pq.empty()) {
    Node now = pq.top();
    pq.pop();
    cnt = 0;
    while (now.num) {
      if (pq.empty()) return 0;
      Node temp = pq.top();
      pq.pop();
      temp.num--;
      now.num--;
      rec[cnt++] = temp;
      res[ans++] = make_pair(now.ind, temp.ind);
    }
    for (i = 0; i < cnt; i++)
      if (rec[i].num) pq.push(rec[i]);
  }
  return 1;
}
int main() {
  while (scanf("%d%d", &n, &all) != EOF) {
    int i;
    for (i = 0; i < n; i++) scanf("%d", data + i);
    bool ff = deal();
    if (!ff) {
      printf("No\n");
    } else {
      printf("Yes\n%d\n", ans);
      for (i = 0; i < ans; i++) printf("%d %d\n", res[i].first, res[i].second);
    }
  }
}
