#include <bits/stdc++.h>
using namespace std;
set<pair<int, int> > s;
int n, S;
int a[200500];
vector<pair<int, int> > ans, v;
int main() {
  cin >> n >> S;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    if (a[i] != 0) s.insert(make_pair(a[i], i + 1));
  }
  while (!s.empty()) {
    pair<int, int> a;
    set<pair<int, int> >::iterator it = s.end();
    it--;
    a = *it;
    s.erase(it);
    while (a.first) {
      if (s.empty()) {
        cout << "No" << endl;
        return 0;
      }
      it = s.end();
      it--;
      pair<int, int> b = *it;
      s.erase(it);
      a.first--;
      ans.push_back(make_pair(a.second, b.second));
      if (b.first != 1) v.push_back(make_pair(b.first - 1, b.second));
    }
    for (vector<pair<int, int> >::iterator it1 = v.begin(); it1 != v.end();
         ++it1)
      s.insert(make_pair(it1->first, it1->second));
    v.clear();
  }
  cout << "Yes" << endl;
  cout << ans.size() << endl;
  for (vector<pair<int, int> >::iterator it = ans.begin(); it != ans.end();
       ++it)
    cout << it->first << ' ' << it->second << endl;
}
