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