#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, i, s, x;
  cin >> n;
  long long int a[n], b[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
    if (i == 0)
      b[i] = a[i];
    else
      b[i] = a[i] + b[i - 1];
  }
  s = b[n - 1];
  if (n == 1) {
    if (a[0] == 0)
      cout << "NO";
    else
      cout << "YES" << endl << 1 << endl << "1 1";
  } else {
    x = 0;
    if (s != 0)
      cout << "YES\n1\n1 " << n;
    else {
      for (i = 1; i < n; i++) {
        if (b[i - 1] != 0 && s - b[i - 1] != 0) {
          x = 1;
          cout << "YES" << endl
               << 2 << endl
               << "1 " << i << endl
               << i + 1 << " " << n;
          break;
        }
      }
      if (x == 0) cout << "NO";
    }
  }
  return 0;
}
