#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int arr[n + 1], l[110] = {0}, r[110] = {0};
  long long sum = 0;
  int j = 0, i;
  int count = 0;
  for (i = 0; i < n; i++) {
    scanf("%d", &arr[i]);
    sum += arr[i];
  }
  if (sum != 0) {
    printf("YES\n");
    printf("1\n");
    printf("1 %d\n", n);
    return 0;
  }
  for (i = 0; i < n; i++)
    if (arr[i] != 0) break;
  if (i == n) {
    cout << "NO";
    return 0;
  }
  sum = 0;
  arr[n] = 0;
  cout << "YES\n";
  int start = 0;
  int c = 0;
  for (i = 0; i < n; i++) {
    if (arr[i] != 0) {
      if (sum + arr[i] != 0) {
        sum += arr[i];
      } else {
        sum = arr[i];
        l[c] = start + 1;
        r[c++] = i;
        start = i;
      }
    }
  }
  l[c] = start + 1;
  r[c++] = n;
  cout << c << endl;
  for (i = 0; i < c; i++) cout << l[i] << " " << r[i] << endl;
  return 0;
}
