#include <bits/stdc++.h>
using namespace std;
static const int INF = 500000000;
template <class T>
void debug(T a, T b) {
  for (; a != b; ++a) cerr << *a << ' ';
  cerr << endl;
}
int n, s;
int num[200005];
vector<pair<int, int> > ans;
bool solve() {
  scanf("%d%d", &n, &s);
  priority_queue<pair<int, int> > pq;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &num[i]);
    if (num[i] > 0) pq.push(make_pair(num[i], i));
  }
  while (!pq.empty()) {
    pair<int, int> cur = pq.top();
    pq.pop();
    vector<pair<int, int> > tmp;
    while (cur.first) {
      if (pq.empty()) return false;
      pair<int, int> cur2 = pq.top();
      pq.pop();
      --cur2.first;
      --cur.first;
      ans.push_back(make_pair(cur.second, cur2.second));
      if (cur2.first > 0) tmp.push_back(cur2);
    }
    for (int i = 0; i < tmp.size(); ++i) pq.push(tmp[i]);
  }
  return true;
}
int main() {
  if (solve() == false)
    puts("No");
  else {
    puts("Yes");
    printf("%d\n", (int)ans.size());
    for (int i = 0; i < ans.size(); ++i)
      printf("%d %d\n", ans[i].first + 1, ans[i].second + 1);
  }
  return 0;
}
