#include <bits/stdc++.h>
using namespace std;
const int N = 300005;
pair<int, int> p1, p2, ans[N];
priority_queue<pair<int, int> > q1, q2;
int n, s, a, cnt;
int main() {
  cin >> n >> s;
  for (int i = 1; i <= n; i++) {
    cin >> a;
    q1.push(make_pair(a, i));
  }
  while (!q1.empty()) {
    p1 = q1.top();
    q1.pop();
    while (p1.first) {
      if (q1.size() == 0) {
        cout << "No" << endl;
        return 0;
      } else {
        p2 = q1.top();
        q1.pop();
        p2.first--;
        p1.first--;
        ans[cnt++] = make_pair(p1.second, p2.second);
        if (p2.first) q2.push(p2);
      }
    }
    while (q2.size()) {
      q1.push(q2.top());
      q2.pop();
    }
  }
  cout << "Yes" << endl << s / 2 << endl;
  for (int i = 0; i < cnt; i++) {
    cout << ans[i].first << ' ' << ans[i].second << endl;
  }
  return 0;
}
