#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:1024000000,1024000000")
int _MAX(int a, int b) { return a > b ? a : b; }
int _MIN(int a, int b) { return a > b ? b : a; }
int Scan() {
  int res = 0, flag = 0;
  char ch;
  if ((ch = getchar()) == '-')
    flag = 1;
  else if (ch >= '0' && ch <= '9')
    res = ch - '0';
  while ((ch = getchar()) >= '0' && ch <= '9') res = res * 10 + (ch - '0');
  return flag ? -res : res;
}
void Out(int a) {
  if (a < 0) {
    putchar('-');
    a = -a;
  }
  if (a >= 10) Out(a / 10);
  putchar(a % 10 + '0');
}
const int N = 105;
int a[N], ans[N][2], tot = 0;
int main() {
  int n, cnt = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", a + i);
    if (a[i] == 0) cnt++;
  }
  if (cnt == n) {
    puts("NO");
    return 0;
  } else {
    int q = 0;
    for (int i = 1; i <= n; ++i) {
      if (a[i]) {
        int p = i;
        for (int j = i - 1; j > q; --j) {
          if (a[j] == 0)
            p = j;
          else
            break;
        }
        ans[i][0] = p;
        p = i;
        for (int j = i + 1; j <= n; ++j) {
          if (a[j] == 0)
            p = j;
          else
            break;
        }
        ans[i][1] = p;
        q = p;
      }
    }
  }
  printf("YES\n%d\n", n - cnt);
  for (int i = 1; i <= n; ++i) {
    if (a[i]) printf("%d %d\n", ans[i][0], ans[i][1]);
  }
  return 0;
}
