#include <bits/stdc++.h>
using namespace std;
const int oo = 0x3f3f3f3f;
const double eps = 1e-9;
int update[200005];
int leftcards[200005];
set<pair<int, int>, greater<pair<int, int> > > cards;
int N, S;
int main() {
  scanf("%d %d", &N, &S);
  for (int i = (0); i < (N); ++i) {
    scanf("%d", &leftcards[i + 1]);
    if (leftcards[i + 1]) cards.insert(make_pair(leftcards[i + 1], i + 1));
  }
  vector<pair<int, int> > s;
  while (!cards.empty()) {
    pair<int, int> f = *cards.begin();
    cards.erase(cards.begin());
    int position = 0;
    for (__typeof__((cards).begin()) i = (cards).begin(); i != (cards).end();
         ++i) {
      if (!f.first) break;
      update[position++] = i->second;
      leftcards[i->second]--;
      f.first--;
    }
    if (f.first) {
      printf("No\n");
      return 0;
    }
    for (int i = (0); i < (position); ++i) {
      s.push_back(make_pair(f.second, update[i]));
      set<pair<int, int>, greater<pair<int, int> > >::iterator element;
      element = cards.find(make_pair(leftcards[update[i]] + 1, update[i]));
      if (element == cards.end()) {
        printf("Shit happened\n");
        printf("searching for (%d, %d)\n", leftcards[update[i]] + 1, update[i]);
        for (__typeof__((cards).begin()) i = (cards).begin();
             i != (cards).end(); ++i)
          printf("(%d,%d)", i->first, i->second);
        return 0;
      }
      cards.erase(element);
      if (leftcards[update[i]])
        cards.insert(make_pair(leftcards[update[i]], update[i]));
    }
  }
  printf("Yes\n");
  printf("%d\n", int((s).size()));
  for (int i = (0); i < (int((s).size())); ++i)
    printf("%d %d\n", s[i].first, s[i].second);
}
