#include <bits/stdc++.h>
using namespace std;
int N, S, input;
priority_queue<pair<int, int> > heap;
vector<pair<int, int> > v, graph;
void close() {
  cout << "No" << endl;
  exit(0);
}
int main() {
  ios::sync_with_stdio(0);
  cin >> N >> S;
  for (int i = 1; i <= N; i++) {
    cin >> input;
    if (input) heap.push(make_pair(input, i));
  }
  while (heap.size()) {
    v.resize(0);
    pair<int, int> pii = heap.top();
    heap.pop();
    if (pii.first > heap.size()) close();
    for (int i = 1; i <= pii.first; i++) {
      pair<int, int> pie = heap.top();
      heap.pop();
      pie.first--;
      if (pie.first) v.push_back(pie);
      graph.push_back(make_pair(pii.second, pie.second));
    }
    for (int i = 0; i < v.size(); i++) heap.push(v[i]);
  }
  cout << "Yes" << endl << graph.size() << endl;
  for (int i = 0; i < graph.size(); i++)
    cout << graph[i].first << " " << graph[i].second << endl;
  return 0;
}
