#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, s;
  scanf("%d %d\n", &n, &s);
  set<pair<int, int>, greater<pair<int, int> > > S;
  for (int i = 1; i <= n; i++) {
    int tmp;
    scanf("%d", &tmp);
    if (tmp != 0) S.insert(make_pair(tmp, i));
  }
  vector<pair<int, int> > res;
  while (!S.empty()) {
    pair<int, int> head = *S.begin();
    S.erase(S.begin());
    if (head.first > S.size()) {
      printf("No");
      goto exit;
    }
    vector<pair<int, int> > tmp(head.first);
    for (int i = 0; i < head.first; i++) {
      tmp[i] = *S.begin();
      S.erase(S.begin());
    }
    for (int i = 0; i < tmp.size(); i++) {
      if (--tmp[i].first > 0) S.insert(tmp[i]);
      res.push_back(make_pair(head.second, tmp[i].second));
    }
  }
  printf("Yes\n");
  printf("%d\n", res.size());
  for (int i = 0; i < res.size(); i++)
    printf("%d %d\n", res[i].first, res[i].second);
exit:
  return (0);
}
