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