#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int a[102];
  int nonzer = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] != 0) nonzer++;
  }
  if (nonzer == 0) {
    cout << "NO\n";
  } else {
    cout << "YES\n";
    cout << nonzer << '\n';
    int last = 0, i = 0;
    while (a[i] == 0) i++;
    while (i < n) {
      i++;
      while (i < n && a[i] == 0) i++;
      cout << last + 1 << ' ' << i << '\n';
      last = i;
    }
  }
  return 0;
}
