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