#include <bits/stdc++.h>
using namespace std;
int n;
int a[101];
struct node {
  int l, r;
  int sum;
} ans[101];
int e = 1;
int main() {
  scanf("%d", &n);
  bool ok = false;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i] != 0) ok = true;
  }
  if (ok == false) {
    printf("NO\n");
    return 0;
  }
  ans[e].l = 1;
  ans[e].r = 1;
  ans[e].sum = a[1];
  for (int i = 2; i <= n; i++) {
    if (ans[e].sum == 0) {
      ans[e].sum += a[i];
      ans[e].r = i;
    } else {
      if (ans[e].sum + a[i] == 0) {
        e++;
        ans[e].l = i;
        ans[e].r = i;
        ans[e].sum = a[i];
      } else {
        ans[e].r = i;
        ans[e].sum += a[i];
      }
    }
  }
  printf("YES\n");
  printf("%d\n", e);
  for (int i = 1; i <= e; i++) {
    printf("%d %d\n", ans[i].l, ans[i].r);
  }
}
