#include <bits/stdc++.h>
using namespace std;
string to_string(int x) {
  string s = "";
  while (x != 0) {
    int d = x % 10;
    s += d + '0';
    x /= 10;
  }
  reverse(s.begin(), s.end());
  return s;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int i, cnt = 0;
  int a[105];
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i] == 0) cnt++;
  }
  if (cnt == n)
    cout << "NO"
         << "\n";
  else {
    vector<pair<int, int> > v;
    int k = 1;
    for (i = 1; i <= n; i++) {
      if (a[i] != 0) {
        k = i;
        v.push_back(make_pair(1, i));
        break;
      }
    }
    for (i = k + 1; i <= n; i++) {
      if (a[i] != 0) {
        v.push_back(make_pair(i, i));
      } else if (a[i] == 0 && v.size() > 0) {
        pair<int, int> p = v[v.size() - 1];
        v.pop_back();
        v.push_back(make_pair(p.first, p.second + 1));
      }
    }
    cout << "YES"
         << "\n";
    cout << v.size() << "\n";
    for (i = 0; i < v.size(); i++) {
      cout << v[i].first << " " << v[i].second << "\n";
    }
  }
  return 0;
}
