#include <bits/stdc++.h>
using namespace std;
const long long SZ = 500007;
const long long mod = 1000000007;
long long Set(long long n, long long pos) { return n = n | (1LL << pos); }
long long reset(long long n, long long pos) { return n = n & ~(1LL << pos); }
bool check(long long n, long long pos) { return (bool)(n & (1LL << pos)); }
long long bigmod(long long first, long long y) {
  if (y == 0) return 1;
  long long res = bigmod(first, y / 2);
  res = (res * res) % mod;
  if (y % 2 == 1) res = (res * first) % mod;
  return res;
}
long long par[SZ];
long long Find(long long node) {
  if (par[node] == node) return node;
  return par[node] = Find(par[node]);
}
void Union(long long a, long long b) { par[Find(b)] = Find(a); }
long long i, j, k, n, m, p, f, t, first, second, v1, v2, r, a[SZ];
int main() {
  priority_queue<pair<long long, long long>,
                 vector<pair<long long, long long> > >
      pq;
  cin >> n >> m;
  for (long long i = 1; i <= n; i++) {
    cin >> first;
    if (first > 0) pq.push({first, i});
  }
  vector<pair<long long, long long> > v;
  while (!pq.empty()) {
    pair<long long, long long> first = pq.top();
    pq.pop();
    set<long long> st;
    vector<pair<long long, long long> > v2;
    while (!pq.empty()) {
      pair<long long, long long> tp = pq.top();
      pq.pop();
      if (st.find(tp.second) == st.end()) {
        tp.first--;
        first.first--;
        v.push_back({first.second, tp.second});
        st.insert(tp.second);
        if (tp.first > 0) pq.push(tp);
        if (first.first == 0) break;
      } else {
        v2.push_back({tp});
      }
    }
    for (auto first : v2) pq.push(first);
    if (first.first > 0) {
      cout << "No"
           << "\n";
      return 0;
    }
  }
  cout << "Yes"
       << "\n";
  cout << v.size() << "\n";
  for (auto first : v) cout << first.first << " " << first.second << "\n";
  ;
  return 0;
}
