#include <bits/stdc++.h>
using namespace std;
bool is_good(int arr[], int part, int n) {
  long long int sum1 = 0, sum2 = 0;
  for (int i = 0; i < part; i++) sum1 += arr[i];
  for (int i = part; i < n; i++) sum2 += arr[i];
  if (sum1 == 0 || sum2 == 0)
    return false;
  else
    return true;
}
int main() {
  int n;
  cin >> n;
  int arr[n];
  long long int sumabs = 0, sumtrue = 0;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    sumabs += abs(arr[i]);
    sumtrue += arr[i];
  }
  if (sumabs == 0)
    cout << "NO" << endl;
  else if (sumtrue != 0) {
    cout << "YES" << endl;
    cout << 1 << endl;
    cout << 1 << ' ' << n << endl;
  } else {
    bool flagout = false;
    for (int i = 1; i < n; i++) {
      bool flag = is_good(arr, i, n);
      if (flag == true) {
        cout << "YES" << endl;
        cout << 2 << endl;
        cout << 1 << ' ' << i << endl;
        cout << i + 1 << ' ' << n << endl;
        flagout = true;
        break;
      }
    }
    if (flagout == false) cout << "NO" << endl;
  }
}
