#include <bits/stdc++.h>
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  size_t n, s;
  std::cin >> n >> s;
  std::priority_queue<std::pair<size_t, size_t>> pq;
  for (size_t i = 1; i <= n; ++i) {
    size_t cnt;
    std::cin >> cnt;
    if (cnt != 0) {
      pq.emplace(cnt, i);
    }
  }
  std::vector<std::pair<size_t, size_t>> result;
  bool ok = true;
  while (!pq.empty()) {
    std::pair<size_t, size_t> top = pq.top();
    pq.pop();
    if (top.first > pq.size()) {
      ok = false;
      break;
    }
    std::vector<std::pair<size_t, size_t>> cur;
    while (cur.size() < top.first) {
      cur.push_back(pq.top());
      pq.pop();
    }
    for (auto& pair : cur) {
      result.emplace_back(top.second, pair.second);
      if (pair.first != 1) {
        pair.first -= 1;
        pq.push(pair);
      }
    }
  }
  if (!ok) {
    std::cout << "No\n";
    return 0;
  }
  std::cout << "Yes\n";
  std::cout << result.size() << '\n';
  for (const auto& [a, b] : result) {
    std::cout << a << ' ' << b << '\n';
  }
}
