#include <bits/stdc++.h>
using namespace std;
int c[105], sum[105];
pair<int, int> p[105];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &c[i]);
    sum[i] = sum[i - 1] + c[i];
  }
  int st = 1, tot = 0;
  for (int i = 1; i <= n; i++) {
    if (sum[i] - sum[st - 1] < 0 && (c[i + 1] > 0 || i == n))
      p[++tot].first = st, p[tot].second = i, st = i + 1;
    else if (sum[i] - sum[st - 1] > 0 && (c[i + 1] < 0 || i == n))
      p[++tot].first = st, p[tot].second = i, st = i + 1;
  }
  if (st != n + 1)
    printf("NO");
  else {
    printf("YES\n%d\n", tot);
    for (int i = 1; i <= tot; i++) printf("%d %d\n", p[i].first, p[i].second);
  }
}
