#include <bits/stdc++.h>
using namespace std;
long long n, m, k, l, r, a[10010];
;
struct node {
  long long l, r;
} ans[10010];
int main() {
  cin >> n;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  l = 1;
  while (l <= n) {
    long long tot = a[l];
    r = l;
    if (tot == 0) {
      while (tot + a[r + 1] == 0 && r <= n) {
        r++;
        tot += a[r];
      }
      if (r > n) {
        cout << "NO";
        return 0;
      }
    }
    while (tot + a[r + 1] != 0 && r <= n) {
      r++;
      tot += a[r];
    }
    if (r > n) {
      r--;
    }
    ans[++k].l = l;
    ans[k].r = r;
    l = r + 1;
  }
  cout << "YES" << endl << k << endl;
  for (long long i = 1; i <= k; i++)
    cout << ans[i].l << " " << ans[i].r << endl;
  return 0;
}
