#include <bits/stdc++.h>
using namespace std;
int arr[101];
int n;
vector<pair<int, int> > ans;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
  }
  int l = 1;
  int sum = 0;
  int i = 1;
  while (i <= n && arr[i] == 0) {
    i++;
  }
  if (i == n + 1) {
    puts("NO");
    return 0;
  }
  for (; i <= n; i++) {
    sum += arr[i];
    if (sum == 0) {
      sum += arr[i];
      ans.push_back({l, i - 1});
      l = i;
    }
  }
  ans.push_back({l, n});
  puts("YES");
  cout << ans.size() << endl;
  for (i = 0; i < ans.size(); i++) {
    cout << ans[i].first << " " << ans[i].second << endl;
  }
}
