#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
int n, s, c[N];
priority_queue<pair<int, int> > pq;
vector<pair<int, int> > ans;
vector<pair<int, int> > vec;
void solve() {
  pair<int, int> x, y;
  int cnt = 0;
  while (!pq.empty()) {
    x = pq.top();
    pq.pop();
    if (pq.size() < x.first) return;
    vec.clear();
    while (x.first--) {
      y = pq.top();
      pq.pop();
      if (!y.first) return;
      vec.push_back(y);
      ans.push_back({x.second, y.second});
    }
    for (int i = 0; i < vec.size(); i++) {
      y = vec[i];
      if (--y.first) pq.push(y);
    }
  }
}
int main() {
  scanf("%d%d", &n, &s);
  for (int i = 0; i < n; i++) {
    scanf("%d", c + i);
    pq.push({c[i], i});
  }
  solve();
  if (ans.size() < s / 2 || s % 2)
    puts("No");
  else {
    puts("Yes");
    printf("%d\n", s / 2);
    for (int i = 0; i < ans.size(); i++)
      printf("%d %d\n", ans[i].first + 1, ans[i].second + 1);
  }
  return 0;
}
