#include <bits/stdc++.h>
using namespace std;
int main() {
  int tot = 0, tmp, n, l = -1;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> tmp;
    tot += tmp;
    if (tmp) l = i;
  }
  if (l == -1) {
    cout << "NO\n";
    return 0;
  }
  if (tot != 0) {
    cout << "YES" << endl << 1 << endl << 1 << " " << n << endl;
    return 0;
  }
  cout << "YES" << endl
       << 2 << endl
       << 1 << " " << l << endl
       << l + 1 << " " << n << endl;
}
