#include <bits/stdc++.h>
using namespace std;
int n, a[123];
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  vector<pair<int, int> > res;
  int s = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] != 0) {
      res.push_back(make_pair(s + 1, i + 1));
      s = i + 1;
    }
  }
  if (res.empty()) {
    cout << "NO"
         << "\n";
  } else {
    cout << "YES"
         << "\n";
    int sz = res.size();
    cout << sz << "\n";
    for (int i = 0; i < sz - 1; i++) {
      cout << res[i].first << " " << res[i].second << "\n";
    }
    cout << res[sz - 1].first << " " << max(n, res[sz - 1].second) << "\n";
  }
  return 0;
}
