#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long sum = 0;
  long long pos = -1;
  for (int i = 0; i < n; i += 1) {
    int x;
    cin >> x;
    sum += x;
    if (sum != 0) {
      pos = i;
    }
  }
  if (sum == 0) {
    if (pos == -1) {
      cout << "NO\n";
    } else {
      cout << "YES\n";
      cout << "2\n"
           << 1 << ' ' << pos + 1 << '\n'
           << pos + 2 << ' ' << n << '\n';
    }
  } else {
    cout << "YES\n1\n1 " << n << '\n';
  }
}
