#include <bits/stdc++.h>
using namespace std;
int a[10001];
int main() {
  int n;
  cin >> n;
  int s = 0;
  bool al_z = true;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i] != 0) al_z = false;
    s += a[i];
  }
  if (s != 0) {
    cout << "YES\n1\n1 " << n << '\n';
  } else {
    if (al_z) {
      cout << "NO";
    } else {
      int ss = 0;
      int i = 1;
      while (ss == 0 && i <= n) {
        ss += a[i];
        i++;
      }
      cout << "YES\n2\n1 " << i - 1 << "\n" << i << " " << n;
    }
  }
  return 0;
}
