#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 111;
int n;
int k;
int a[MAX_N];
int l[MAX_N];
int r[MAX_N];
int main() {
  bool f = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  for (int i = 0; i < n; i++)
    if (a[i] != 0) f = 1;
  if (f == 0) {
    puts("NO");
    return 0;
  }
  a[n] = 1;
  f = 0;
  for (int i = 0; i <= n; i++) {
    if (f) {
      if (a[i] == 0)
        r[k] = i;
      else {
        k++;
        l[k] = i;
        r[k] = i;
      }
    } else {
      if (a[i] == 0)
        r[k] = i;
      else
        f = 1, r[k] = i;
    }
  }
  puts("YES");
  printf("%d\n", k);
  for (int i = 0; i < k; i++) {
    printf("%d %d\n", l[i] + 1, r[i] + 1);
  }
  return 0;
}
