#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int a[N], num[N];
int main() {
  int n;
  cin >> n;
  bool flag = false;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i] != 0) flag = true;
  }
  if (flag) {
    cout << "YES" << endl;
    int sum = 0, cnt = 0;
    num[cnt++] = 1;
    for (int i = 1; i <= n; i++) {
      while (a[i] == 0) i++;
      sum += a[i];
      if (sum == 0) {
        sum = a[i];
        num[cnt++] = i - 1;
        num[cnt++] = i;
      }
    }
    num[cnt++] = n;
    cout << cnt / 2 << endl;
    for (int i = 0; i < cnt; i += 2) printf("%d %d\n", num[i], num[i + 1]);
  } else
    cout << "NO" << endl;
  return 0;
}
