#include <bits/stdc++.h>
using namespace std;
const int maxn = 200010;
int n, s, m;
struct Node {
  int d, id;
  bool operator<(const Node &o) const { return d < o.d; }
} a[maxn], b[maxn];
priority_queue<Node> q;
vector<pair<int, int> > ans;
bool solve() {
  while (!q.empty()) q.pop();
  for (int i = 1; i <= n; i++)
    if (a[i].d > 0) q.push(a[i]);
  while (!q.empty()) {
    Node x = q.top();
    q.pop();
    if (x.d > q.size()) return 0;
    m = 0;
    while (x.d--) {
      Node y = q.top();
      q.pop();
      ans.push_back(make_pair(x.id, y.id));
      y.d--;
      if (y.d > 0) b[m++] = y;
    }
    for (int i = 0; i < m; i++) q.push(b[i]);
  }
  return 1;
}
int main() {
  while (cin >> n >> s) {
    for (int i = 1; i <= n; i++) {
      cin >> a[i].d;
      a[i].id = i;
    }
    ans.clear();
    bool yes = solve();
    if (yes) {
      cout << "Yes" << endl;
      cout << ans.size() << endl;
      for (int i = 0; i < ans.size(); i++)
        cout << ans[i].first << " " << ans[i].second << endl;
    } else
      cout << "No" << endl;
  }
  return 0;
}
