#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base ::sync_with_stdio(false);
  int n, sum = 0;
  cin >> n;
  vector<int> vec(200007, 0);
  vector<pair<int, int> > res;
  for (int i = 1; i <= n; ++i) {
    cin >> vec[i];
    sum += vec[i];
  }
  if (sum) {
    cout << "YES" << endl;
    cout << 1 << endl;
    cout << 1 << " " << n << endl;
    return 0;
  }
  int i = 1;
  bool found = false;
  while (i <= n) {
    sum -= vec[i];
    if (sum) {
      res.push_back({1, i});
      res.push_back({i + 1, n});
      found = true;
      break;
    }
    i++;
  }
  if (!found) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  cout << res.size() << endl;
  for (auto x : res) cout << x.first << " " << x.second << endl;
  return 0;
}
