#include <bits/stdc++.h>
using namespace std;
pair<int, int> ans[105];
int main() {
  int n, a[105], p = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    if (a[i] != 0 && p == 0) {
      p = i;
    }
  }
  if (p == 0) {
    printf("NO\n");
    return 0;
  }
  int x = 1, y = p, pos = 0;
  for (int i = p + 1; i <= n; ++i) {
    if (a[i] != 0) {
      ans[pos++] = make_pair(x, y);
      x = y + 1, y = x;
    } else {
      y++;
    }
  }
  ans[pos++] = make_pair(x, y);
  printf("YES\n");
  printf("%d\n", pos);
  for (int i = 0; i < pos; ++i) printf("%d %d\n", ans[i].first, ans[i].second);
}
