#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0;
  char c = getchar();
  while (c < 48 || c > 57) c = getchar();
  while (c > 47 && c < 58) x *= 10, x += c - 48, c = getchar();
  return x;
}
int n, a[105], f[105], s[105], l[105];
int ansl[105], ansr[105];
void init() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", a + i);
    s[i] = s[i - 1] + a[i];
  }
}
void solve() {
  f[0] = 1;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= i; ++j)
      if (f[j - 1] && s[i] - s[j - 1] != 0) {
        f[i] = f[j - 1] + 1;
        l[i] = j;
        break;
      }
  if (!f[n]) {
    puts("NO");
    return;
  }
  printf("YES\n%d\n", f[n] - 1);
  int t = n;
  for (int i = n; i; i = l[i] - 1) {
    ansl[--t] = l[i];
    ansr[t] = i;
  }
  for (int i = t; i < n; ++i) printf("%d %d\n", ansl[i], ansr[i]);
}
int main() {
  init();
  solve();
  return 0;
}
