#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, s;
  cin >> n >> s;
  priority_queue<pair<int, int> > q;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    q.push({a, i + 1});
  }
  vector<pair<int, int> > v;
  for (int i = 0; i < n; i++) {
    auto p = q.top();
    q.pop();
    vector<pair<int, int> > temp;
    for (int j = 0; j < p.first; j++) {
      if (q.empty()) {
        cout << "No\n";
        return 0;
      }
      auto d = q.top();
      q.pop();
      if (d.first == 0) {
        cout << "No\n";
        return 0;
      }
      v.push_back({p.second, d.second});
      d.first--;
      temp.push_back(d);
    }
    for (auto a : temp) q.push(a);
  }
  cout << "Yes\n";
  cout << v.size() << "\n";
  for (auto a : v) cout << a.first << " " << a.second << "\n";
  return 0;
}
