#include <bits/stdc++.h>
using namespace std;
const int max_n = 105;
int a[max_n];
int n;
struct point {
  int left;
  int right;
} p[max_n];
int main() {
  cin >> n;
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i] == 0) {
      cnt++;
    }
  }
  if (cnt == n) {
    printf("NO\n");
    return 0;
  }
  cnt = 0;
  p[cnt].left = 1;
  int tol = 0;
  int flag = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i]) {
      flag = 1;
    }
    tol += a[i];
    if (tol == 0 && flag) {
      p[cnt++].right = i - 1;
      tol = a[i];
      flag = 0;
      p[cnt].left = i;
    }
  }
  cout << "YES" << endl;
  cout << cnt + 1 << endl;
  for (int i = 0; i < cnt; i++) {
    cout << p[i].left << " " << p[i].right << endl;
  }
  if (p[cnt].right != n) {
    cout << p[cnt].left << " " << n << endl;
  }
  return 0;
}
