#include <bits/stdc++.h>
using namespace std;
int a[110], arr[110];
int main() {
  int n, i, j, k = 2, sum = 0, cnt = 0, c = 1;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i] == 0) cnt++;
  }
  if (cnt == n) {
    cout << "NO\n";
    return 0;
  }
  cout << "YES\n";
  arr[1] = 1;
  for (i = 1; i <= n; i++) {
    if (sum != 0 && a[i] != 0 && sum + a[i] == 0) {
      c++;
      arr[k++] = i - 1;
      arr[k++] = i;
      sum = a[i];
    } else
      sum += a[i];
  }
  cout << c << '\n';
  arr[2 * c] = n;
  for (i = 1; i <= k; i += 2) {
    cout << arr[i] << " " << arr[i + 1];
    cout << '\n';
  }
  return 0;
}
