#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, s;
  scanf("%d %d", &n, &s);
  int a[n + 1];
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
  }
  int flag = 0;
  for (int i = 1; i <= n; ++i) {
    if (a[i] >= n) flag = 1;
  }
  if (flag) {
    cout << "No" << '\n';
    return 0;
  }
  set<pair<int, int> > S;
  for (int i = 1; i <= n; ++i) {
    if (a[i] != 0) S.insert(make_pair(a[i], i));
  }
  set<pair<int, int> >::iterator it, ip, ix;
  it = S.end();
  it--;
  ix = S.begin();
  ix--;
  vector<pair<int, int> > ans;
  while (true) {
    it = S.end();
    it--;
    ix = S.begin();
    ix--;
    int a = (*it).first;
    int b = (*it).second;
    vector<pair<int, int> > A;
    ip = it;
    ip--;
    while (a > 0) {
      A.push_back((*ip));
      a--;
      ip--;
      if (ip == ix) break;
    }
    if (a != 0) {
      cout << "No" << '\n';
      return 0;
    }
    S.erase(it);
    for (int i = 0; i < A.size(); ++i) {
      S.erase(A[i]);
    }
    for (int i = 0; i < A.size(); ++i) {
      if (A[i].first > 1) S.insert(make_pair(A[i].first - 1, A[i].second));
      ans.push_back(make_pair(A[i].second, b));
    }
    if (S.empty()) break;
  }
  cout << "Yes" << '\n';
  cout << ans.size() << '\n';
  for (int i = 0; i < ans.size(); ++i)
    cout << ans[i].first << " " << ans[i].second << '\n';
  return 0;
}
