#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  ios::sync_with_stdio(0);
  int size;
  cin >> size;
  int v[size];
  bool zero = false;
  bool nonzero = false;
  int i;
  int sum = 0;
  for (i = 0; i < size; ++i) {
    cin >> v[i];
    sum += v[i];
    if (v[i] == 0) zero = true;
    if (v[i] != 0) nonzero = true;
  }
  if (sum != 0) {
    cout << "YES\n";
    cout << "1\n";
    cout << "1 " << size << "\n";
    return 0;
  }
  if (nonzero == false) {
    cout << "NO\n";
    return 0;
  }
  if (zero == false) {
    cout << "YES\n";
    cout << "2\n";
    cout << "1 1\n";
    cout << "2 " << size << "\n";
    return 0;
  }
  sum = 0;
  for (i = 0; i < size; ++i) {
    sum += v[i];
    if (sum != 0) break;
  }
  cout << "YES\n";
  cout << "2\n";
  cout << "1 " << i + 1 << "\n";
  cout << i + 2 << " " << size << "\n";
  return 0;
}
