#include <bits/stdc++.h>
using namespace std;
struct Player {
  int id, cards;
  bool operator<(const Player& a) const { return cards < a.cards; }
} player[200010];
struct Swap {
  int x, y;
  Swap(int x, int y) { this->x = x, this->y = y; }
};
std::priority_queue<Player> que;
std::vector<Swap> ans;
int main() {
  int n, s;
  while (cin >> n >> s) {
    for (int i = 1; i <= n; ++i) {
      cin >> player[i].cards;
      player[i].id = i;
      if (player[i].cards) {
        que.push(player[i]);
      }
    }
    bool possible = true;
    while (!que.empty() && possible) {
      player[0] = que.top();
      que.pop();
      for (int i = 1; i <= player[0].cards; ++i) {
        if (que.empty()) {
          possible = false;
          break;
        }
        player[i] = que.top();
        que.pop();
      }
      for (int i = 1; i <= player[0].cards; ++i) {
        ans.push_back(Swap(player[0].id, player[i].id));
        if (--player[i].cards) {
          que.push(player[i]);
        }
      }
    }
    if (possible) {
      cout << "Yes" << endl << ans.size() << endl;
      for (int i = 0; i < ans.size(); ++i) {
        cout << ans[i].x << ' ' << ans[i].y << endl;
      }
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
