#include <bits/stdc++.h>
using namespace std;
int A[110], n, r[110], cnt;
bool f;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> A[i];
  for (int i = 0; i < n; i++) {
    if (A[i] == 0 && cnt == 0)
      f = 1, r[cnt] = i + 1;
    else if (A[i] == 0)
      r[cnt - 1] = i + 1;
    else if (A[i] != 0)
      r[cnt++] = i + 1, f = 0;
  }
  if (f)
    cout << "NO" << endl;
  else {
    cout << "YES" << endl;
    cout << cnt << endl;
    int l = 1;
    for (int i = 0; i < cnt; i++) {
      cout << l << " " << r[i] << endl;
      l = r[i] + 1;
    }
  }
  return 0;
}
