#include <bits/stdc++.h>
using namespace std;
multiset<pair<int, int> > f;
vector<pair<int, int> > ans, r;
int n, m;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; ++i) {
    int v;
    scanf("%d", &v);
    if (v) f.insert(make_pair(m - v, i));
  }
  for (int i = 0; i < n; ++i) {
    if (f.size() < 1) break;
    int x = f.begin()->second, xv = m - f.begin()->first;
    f.erase(f.begin());
    r.clear();
    for (int j = 0; j < xv; ++j) {
      if (f.size() < 1) {
        puts("No");
        return 0;
      }
      int y = f.begin()->second, yv = m - f.begin()->first;
      f.erase(f.begin());
      ans.push_back(make_pair(x + 1, y + 1));
      if (yv > 1) r.push_back(make_pair(m - yv + 1, y));
    }
    for (int j = 0; j < r.size(); ++j) f.insert(r[j]);
  }
  puts("Yes");
  printf("%d\n", m / 2);
  for (int i = 0; i < ans.size(); ++i)
    printf("%d %d\n", ans[i].first, ans[i].second);
  return 0;
}
