#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100000 + 10, mod = 1000000007;
int s = 0, no, po;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie();
  cout.tie();
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    s += a[i];
    if (a[i] != 0 && !no) no = 1, po = i;
  }
  if (s != 0) {
    cout << "YES " << endl;
    cout << "1\n";
    cout << "1 " << n;
  } else {
    if (!no) return cout << "NO", 0;
    cout << "YES\n";
    cout << "2" << endl;
    cout << "1"
         << " " << po + 1 << endl;
    cout << po + 2 << " " << n;
  }
  return 0;
}
