#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 100;
int d[maxn];
vector<pair<int, int> > e;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, S;
  cin >> n >> S;
  for (int i = 1; i <= n; i++) cin >> d[i];
  set<pair<int, int> > s;
  for (int i = 1; i <= n; i++)
    if (d[i] != 0) s.insert(make_pair(-d[i], i));
  while (s.size()) {
    int fr = s.begin()->second;
    s.erase(s.begin());
    if (d[fr] > s.size()) {
      cout << "No" << endl;
      return 0;
    }
    vector<int> child;
    for (int i = 0; i < d[fr]; i++) {
      child.push_back((s.begin()->second));
      s.erase(s.begin());
    }
    for (int i = 0; i < child.size(); i++) d[child[i]]--;
    for (int i = 0; i < child.size(); i++) e.push_back(make_pair(fr, child[i]));
    for (int i = 0; i < child.size(); i++)
      if (d[child[i]] != 0) s.insert(make_pair(-d[child[i]], child[i]));
  }
  cout << "Yes" << endl;
  cout << e.size() << endl;
  for (int i = 0; i < e.size(); i++)
    cout << e[i].first << " " << e[i].second << endl;
  return 0;
}
