#include <bits/stdc++.h>
using namespace std;
struct node {
  int id, d;
};
const int maxn = 200010, maxm = 200010;
int n, m, ans[maxm][2];
node w[maxn];
inline bool operator<(const node &a, const node &b) { return a.d < b.d; }
priority_queue<node> Q;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    node p;
    p.id = i + 1;
    scanf("%d", &p.d);
    Q.push(p);
  }
  bool flag = true;
  int top = 0;
  for (int i = 0; i < n; i++) {
    node p = Q.top();
    Q.pop();
    if (Q.size() < p.d) {
      flag = false;
      break;
    }
    int s = 0;
    for (int i = 0; i < p.d; i++) {
      node q = Q.top();
      Q.pop();
      ans[top][0] = p.id;
      ans[top++][1] = q.id;
      q.d--;
      w[s++] = q;
    }
    for (int i = 0; i < s; i++) Q.push(w[i]);
  }
  if (flag) {
    printf("Yes\n%d\n", top);
    for (int i = 0; i < top; i++) printf("%d %d\n", ans[i][0], ans[i][1]);
  } else {
    printf("No\n");
  }
  return 0;
}
