#include <bits/stdc++.h>
using namespace std;
struct node {
  int neigh;
  int num;
};
struct orderByNeigh {
  bool operator()(node i, node j) { return i.neigh < j.neigh; }
};
int n, s, a;
int ans = 0;
pair<int, int> pans[200005];
node cur;
node del;
vector<node> vec;
priority_queue<node, vector<node>, orderByNeigh> pq;
int main() {
  while (!pq.empty()) pq.pop();
  scanf("%d %d", &n, &s);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a);
    if (a != 0) {
      node x;
      x.neigh = a;
      x.num = i;
      pq.push(x);
    }
  }
  while (!pq.empty()) {
    cur = pq.top();
    pq.pop();
    vec.clear();
    for (int i = 0; i < cur.neigh; i++) {
      if (pq.empty()) {
        printf("No\n");
        return 0;
      }
      del = pq.top();
      pq.pop();
      pans[ans++] = make_pair(cur.num, del.num);
      del.neigh--;
      if (del.neigh > 0) vec.push_back(del);
    }
    for (int i = 0; i < vec.size(); i++) pq.push(vec[i]);
  }
  printf("Yes\n");
  printf("%d\n", ans);
  for (int i = 0; i < ans; i++)
    printf("%d %d\n", pans[i].first + 1, pans[i].second + 1);
  return 0;
}
