#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000005;
int main() {
  ios_base::sync_with_stdio(0);
  int n, sum = 0, j = -1;
  cin >> n;
  vector<int> tab(n);
  for (unsigned i = 0; i < (n); i++) {
    cin >> tab[i];
    sum += tab[i];
  }
  if (sum != 0) {
    cout << "YES" << endl << 1 << endl << 1 << " " << n;
    return 0;
  }
  sum = 0;
  int i = 0;
  while (sum == 0 && i < n) {
    sum += tab[i];
    ++i;
  }
  if (i == n) {
    cout << "NO";
    return 0;
  }
  cout << "YES" << endl
       << 2 << endl
       << 1 << " " << i << endl
       << i + 1 << " " << n;
  return 0;
}
