#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 + 5;
vector<pair<int, int> > v;
int a[maxn];
int main() {
  int n;
  cin >> n;
  int s = 1;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i] != 0) {
      v.push_back(make_pair(s, i));
      s = i + 1;
    }
  }
  if (v.size() == 0) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
    cout << v.size() << endl;
    for (int i = 0; i < v.size() - 1; i++)
      cout << v[i].first << " " << v[i].second << endl;
    cout << v[v.size() - 1].first << " " << n << endl;
  }
  return 0;
}
