#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int mod = 1e9 + 7;
const long long inf = 1e16 + 10;
int a[102], f[102];
map<char, int> m;
int main() {
  int n, k;
  scanf("%d", &n);
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i] != 0) ans++, k = i;
  }
  if (!ans) {
    puts("NO");
    return 0;
  }
  puts("YES");
  printf("%d\n", ans);
  int m = 1;
  for (int i = 1; i <= n; i++) {
    if (a[i] != 0) {
      if (i == k) {
        printf("%d %d\n", m, n);
        return 0;
      } else {
        printf("%d %d\n", m, i);
        m = i + 1;
      }
    }
  }
  return 0;
}
