#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < N; i++) {
    cin >> a[i];
  }
  vector<int> s(N + 1);
  for (int i = 1; i <= N; i++) {
    s[i] = s[i - 1] + a[i - 1];
  }
  if (s[N] != 0) {
    cout << "YES" << endl;
    cout << 1 << endl;
    cout << 1 << " " << N << endl;
    return 0;
  }
  for (int i = 1; i <= N; i++) {
    if (s[i] != 0) {
      cout << "YES" << endl;
      cout << 2 << endl;
      cout << 1 << " " << i << endl;
      cout << i + 1 << " " << N << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
  return 0;
}
