#include <bits/stdc++.h>
using namespace std;
int N, A[101];
int main() {
  scanf("%d", &N);
  for (int i = 0; i < N; i++) scanf("%d", &A[i]);
  vector<pair<int, int> > res;
  int lo = 0, sum = 0;
  for (int i = 0; i < N; i++) {
    if (A[i] != 0) res.push_back({lo, i}), lo = i + 1;
  }
  if (res.size() == 0)
    printf("NO\n");
  else {
    printf("YES\n");
    res[res.size() - 1].second = N - 1;
    printf("%d\n", (int)res.size());
    for (int i = 0; i < res.size(); i++)
      printf("%d %d\n", res[i].first + 1, res[i].second + 1);
  }
}
