#include <bits/stdc++.h>
using namespace std;
int n, s, x;
deque<pair<int, int> > c;
deque<pair<int, int> > ans;
int upb(int l, int x) {
  int r = (int)c.size() - 1, mid;
  while (r - l > 1) {
    mid = (l + r) >> 1;
    if (c[mid].first == x)
      l = mid;
    else
      r = mid - 1;
  }
  if (c[r].first == x) return r;
  if (c[l].first == x) return l;
  throw 1;
}
int lb(int r, int x) {
  int l = 0, mid;
  while (r - l > 1) {
    mid = (l + r) >> 1;
    if (c[mid].first == x)
      r = mid;
    else
      l = mid + 1;
  }
  if (c[l].first == x) return l;
  if (c[r].first == x) return r;
  throw 1;
}
int main() {
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    cin >> x;
    c.push_back(make_pair(x, i + 1));
  }
  sort(c.begin(), c.end(), greater<pair<int, int> >());
  while (s) {
    pair<int, int> t = c.front();
    c.pop_front();
    for (int i = 0; i < t.first; i++) {
      if (i == (int)c.size() || !c[i].first) return cout << "No\n", 0;
      ans.push_back(make_pair(t.second, c[i].second));
      c[i].first--;
    }
    int r = t.first, l = t.first - 1;
    if (r < (int)c.size() && l >= 0 && c[r].first > c[l].first) {
      x = c[r].first;
      r = upb(r, x);
      l = lb(l, x - 1);
      while (r > l && c[r].first > c[l].first) {
        swap(c[r], c[l]);
        r--;
        l++;
      }
    }
    s -= 2 * t.first;
    assert(s >= 0);
  }
  cout << "Yes\n";
  cout << ans.size() << '\n';
  for (size_t i = 0; i < ans.size(); i++)
    cout << ans[i].first << ' ' << ans[i].second << '\n';
  return 0;
}
