#include <bits/stdc++.h>
using namespace std;
const int MAXn = 200000;
int n, s;
int d[MAXn];
priority_queue<pair<int, int> > pq;
vector<pair<int, int> > sol;
void noSolution() {
  cout << "No" << endl;
  exit(0);
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    cin >> d[i];
    if (d[i] != 0) pq.push(pair<int, int>(d[i], i));
  }
  while (!pq.empty()) {
    pair<int, int> p = pq.top();
    pq.pop();
    vector<int> v;
    v.clear();
    for (int i = 0; i < p.first; i++) {
      if (pq.empty()) noSolution();
      pair<int, int> p2 = pq.top();
      pq.pop();
      v.push_back(p2.second);
      d[p2.second]--;
      sol.push_back(pair<int, int>(p.second, p2.second));
    }
    for (int i = 0; i < (int)v.size(); i++)
      if (d[v[i]] != 0) pq.push(pair<int, int>(d[v[i]], v[i]));
  }
  cout << "Yes" << endl;
  cout << sol.size() << endl;
  for (int i = 0; i < (int)sol.size(); i++)
    cout << sol[i].first + 1 << " " << sol[i].second + 1 << endl;
  return 0;
}
