#include <bits/stdc++.h>
using namespace std;
int aa[105], bb[105][2];
int main() {
  int n, m, k = 0, f = 1, sum;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &aa[i]);
  m = 0;
  while (aa[m] == 0 && m < n) m++;
  if (m == n)
    f = 0;
  else {
    bb[0][0] = 1;
    sum = aa[m];
    if (m == n - 1) {
      bb[0][1] = n;
      k = 1;
    } else {
      for (int i = m + 1; i < n; i++) {
        if (sum + aa[i] == 0) {
          bb[k][1] = i;
          k++;
          bb[k][0] = i + 1;
          sum = aa[i];
        } else
          sum += aa[i];
      }
      if (bb[k][1] == 0) bb[k++][1] = n;
    }
  }
  if (f) {
    printf("YES\n%d\n", k);
    for (int i = 0; i < k; i++) printf("%d %d\n", bb[i][0], bb[i][1]);
  } else
    printf("NO");
  return 0;
}
