#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 11;
int n, a[N], p;
int main() {
  int sum = 0, ok = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i], sum += a[i];
  }
  if (sum != 0) {
    cout << "YES\n";
    cout << 1 << '\n' << 1 << ' ' << n;
    return 0;
  }
  for (int i = n - 1; i >= 0; --i)
    if (a[i] != 0) {
      ok = 1, p = i;
      break;
    }
  if (!ok) return cout << "NO", 0;
  cout << "YES\n";
  cout << "2\n";
  cout << 1 << ' ' << p << '\n' << p + 1 << ' ' << n;
}
