#include <bits/stdc++.h>
using namespace std;
multiset<pair<int, int> > s;
vector<pair<int, int> > tmp, ans;
int main() {
  int n, ss;
  cin >> n >> ss;
  for (int i = 0, a; i < n; i++) cin >> a, s.insert({-a, i});
  while (s.size()) {
    tmp.clear();
    auto b = *s.begin();
    s.erase(s.begin());
    while (s.size() && b.first) {
      auto i = *s.begin();
      s.erase(s.begin());
      if (!i.first) return cout << "No", 0;
      ans.push_back({b.second, i.second});
      tmp.push_back(i);
      b.first++;
    }
    if (b.first) return cout << "No", 0;
    for (auto i : tmp) s.insert({i.first + 1, i.second});
  }
  cout << "Yes\n" << ans.size() << '\n';
  for (auto i : ans) cout << i.first + 1 << " " << i.second + 1 << '\n';
}
