#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > vi;
priority_queue<pair<int, int> > Q;
stack<pair<int, int> > st;
int main() {
  int n, S, p;
  cin >> n >> S;
  for (int i = 0; i < n; i++) {
    scanf("%d", &p);
    if (p > 0) {
      Q.push(make_pair(p, i + 1));
    }
  }
  while (!Q.empty()) {
    pair<int, int> now = Q.top();
    Q.pop();
    while (!Q.empty() && now.first > 0) {
      pair<int, int> tmp = Q.top();
      Q.pop();
      now.first--;
      tmp.first--;
      vi.push_back(make_pair(now.second, tmp.second));
      if (tmp.first > 0) {
        st.push(tmp);
      }
    }
    if (now.first > 0) {
      printf("No\n");
      return 0;
    }
    while (!st.empty()) {
      Q.push(st.top());
      st.pop();
    }
  }
  printf("Yes\n%d\n", vi.size());
  for (int i = 0; i < vi.size(); i++) {
    printf("%d %d\n", vi[i].first, vi[i].second);
  }
  return 0;
}
