#include <bits/stdc++.h>
int n, a[120], all_zero;
int status;
int l[120], r[120];
int k = 0;
void update(int inx) {
  k++;
  l[k] = r[k] = inx;
}
int main() {
  scanf("%d", &n);
  all_zero = 1;
  for (int ni = 1; ni <= n; ni++) {
    scanf("%d", &a[ni]);
    if (all_zero != 0 && a[ni] != 0) all_zero = 0;
  }
  if (all_zero) {
    printf("NO\n");
    return 0;
  }
  update(1);
  if (a[1] == 0)
    status = 0;
  else
    status = 1;
  for (int ni = 2; ni <= n; ni++) {
    if (status == 1) {
      if (a[ni] != 0) {
        update(ni);
      } else {
        r[k] = ni;
        status = 2;
      }
    } else if (status == 0) {
      if (a[ni] != 0) {
        r[k] = ni;
        status = 1;
      } else {
        r[k] = ni;
      }
    } else {
      if (a[ni] != 0) {
        update(ni);
        status = 1;
      } else {
        r[k] = ni;
      }
    }
  }
  printf("YES\n%d\n", k);
  for (int ki = 1; ki <= k; ki++) {
    printf("%d %d\n", l[ki], r[ki]);
  }
}
