#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  int i, flag = 0;
  int sum = 0, nonzero = 0;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] != 0) {
      flag = 1;
    }
    sum += a[i];
  }
  if (flag != 1) {
    cout << "NO";
    return 0;
  }
  if (sum != 0) {
    cout << "YES" << endl;
    cout << 1 << endl;
    cout << 1 << " " << n;
  } else {
    sum = 0;
    for (i = 0; i < n; i++) {
      sum += a[i];
      if (sum != 0) {
        cout << "YES" << endl;
        cout << 2 << endl;
        cout << 1 << " " << i + 1 << endl;
        cout << i + 2 << " " << n;
        return 0;
      }
    }
  }
  return 0;
}
