#include <bits/stdc++.h>
using namespace std;
const int INF = 2e9 + 10;
const int MOD = 1e9 + 7;
const int N = 1e3 + 10;
int n, k, m;
int a[N];
int main() {
  ios_base::sync_with_stdio(0);
  cout.tie(0);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  vector<pair<int, int>> vec;
  int cnt = 0;
  for (int i = 1; i <= n; i++)
    if (a[i] == 0) cnt++;
  if (cnt == n) {
    cout << "NO";
    return 0;
  }
  int l = 1;
  int r = 1;
  int v = 0;
  while (l <= n) {
    r = l + 1;
    int sum = a[l];
    while (r <= n && sum == 0) {
      sum += a[r];
      r++;
    }
    while (r <= n && a[r] == 0) r++;
    r--;
    vec.push_back({l, r});
    l = r + 1;
  }
  cout << "YES\n";
  cout << (int)vec.size() << "\n";
  for (int i = 0; i < (int)vec.size(); i++)
    cout << vec[i].first << " " << vec[i].second << "\n";
  return 0;
}
