#include <bits/stdc++.h>
using namespace std;
const int MAX = 200 * 1000;
pair<int, int> d[MAX + 10];
pair<int, int> out[MAX + 10];
int head = 0;
int main() {
  ios::sync_with_stdio(false);
  int n, s;
  cin >> n >> s;
  priority_queue<pair<int, int> > heap;
  for (int i = 0; i < n; i++) {
    cin >> d[i].first;
    d[i].second = i + 1;
    if (d[i].first > 0) heap.push(d[i]);
  }
  for (int i = 0; i < n && !heap.empty(); i++) {
    pair<int, int> big = heap.top();
    heap.pop();
    int head2 = 0;
    for (int j = 0; j < big.first; j++) {
      if (heap.empty()) {
        cout << "No" << endl;
        return 0;
      }
      pair<int, int> c = heap.top();
      heap.pop();
      c.first--;
      out[head].first = big.second;
      out[head++].second = c.second;
      if (c.first) d[head2++] = c;
    }
    for (int j = 0; j < head2; j++) heap.push(d[j]);
  }
  cout << "Yes" << endl << head << endl;
  for (int i = 0; i < head; i++)
    cout << out[i].first << " " << out[i].second << endl;
  return 0;
}
