#include <bits/stdc++.h>
using namespace std;
struct pod {
  vector<long long> info;
};
int main() {
  long long numbers;
  cin >> numbers;
  vector<long long> data;
  vector<pod> show;
  long long sum = 0;
  long long numGreaterThan0 = 0;
  long long first = 0;
  for (int i = 0; i < numbers; i++) {
    long long temp;
    cin >> temp;
    sum += temp;
    if (temp != 0) {
      numGreaterThan0++;
    }
    if (first == 0) {
      first = temp;
    }
    data.push_back(temp);
  }
  if (sum != 0) {
    pod temp;
    for (int i = 0; i < numbers; i++) {
      temp.info.push_back(data.at(i));
    }
    show.push_back(temp);
  } else if (numGreaterThan0 >= 2) {
    pod temp;
    for (int i = 0; i < data.size(); i++) {
      if (show.size() > 0 && data.at(i) == 0) {
        show.back().info.push_back(data.at(i));
      } else {
        temp.info.push_back(data.at(i));
      }
      if (data.at(i) != 0) {
        show.push_back(temp);
        temp.info.clear();
      }
    }
  }
  if (show.size() == 0) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
    cout << show.size() << endl;
    long long counter = 1;
    for (int i = 0; i < show.size(); i++) {
      cout << counter << " " << counter + show.at(i).info.size() - 1 << endl;
      counter += show.at(i).info.size();
    }
  }
  return 0;
}
