#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  bool bol = false;
  int tab[101];
  cin >> n;
  int licznik = 0;
  vector<int> wek;
  for (int i = 0; i < n; i++) {
    cin >> tab[i];
    if (tab[i] != 0 && bol == false) {
      cout << "YES" << endl;
      bol = true;
    }
    if (tab[i]) wek.push_back(i);
  }
  if (bol == false)
    cout << "NO";
  else {
    cout << wek.size() << endl;
    cout << "1"
         << " ";
    while (wek.size() > 1) {
      cout << wek[0] + 1 << endl << wek[0] + 2 << " ";
      wek.erase(wek.begin(), wek.begin() + 1);
    }
    cout << n << endl;
  }
  return 0;
}
