#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  std::vector<int> a(1 + n);
  int sum = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    sum += a[i];
  }
  if (n == 1 && a[1] == 0) {
    printf("NO");
    return 0;
  }
  if (n == 1 && a[1] != 0) {
    printf("YES\n");
    printf("1\n");
    printf("1 1");
    return 0;
  }
  int sum1 = 0;
  int l = 1;
  int r = 0;
  for (int i = 1; i <= n; i++) {
    sum1 += a[i];
    r = i;
    if (sum - sum1 != 0 && sum1 != 0) {
      printf("YES\n");
      printf("2\n");
      printf("%d %d\n", l, r);
      printf("%d %d", r + 1, n);
      return 0;
    }
  }
  if (sum != 0) {
    printf("YES\n");
    printf("1\n");
    printf("%d %d", 1, n);
    return 0;
  }
  printf("NO");
  return 0;
}
