#include <bits/stdc++.h>
using namespace std;
template <class T>
T sqr(T x) {
  return x * x;
}
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <class T1, class T2>
T1 chmin(T1& x, const T2& y) {
  if (T1(y) < x) return x = y;
  return x;
}
template <class T1, class T2>
T1 chmax(T1& x, const T2& y) {
  if (T1(y) > x) return x = y;
  return x;
}
template <class T1, class T2>
ostream& operator<<(ostream& os, const pair<T1, T2>& p) {
  return os << '(' << p.first << ", " << p.second << ')';
}
template <class T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  os << '{';
  bool was = false;
  for (const T& x : v) {
    if (was) os << ", ";
    was = true;
    os << x;
  }
  os << '}';
  return os;
}
template <class T>
ostream& operator<<(ostream& os, const set<T>& v) {
  os << '[';
  bool was = false;
  for (const T& x : v) {
    if (was) os << ", ";
    was = true;
    os << x;
  }
  os << ']';
  return os;
}
template <class T>
ostream& operator<<(ostream& os, const multiset<T>& v) {
  os << '[';
  bool was = false;
  for (const T& x : v) {
    if (was) os << ", ";
    was = true;
    os << x;
  }
  os << ']';
  return os;
}
template <class T1, class T2>
ostream& operator<<(ostream& os, const map<T1, T2>& m) {
  os << '<';
  bool was = false;
  for (const auto& x : m) {
    if (was) os << ", ";
    was = true;
    os << x;
  }
  os << '>';
  return os;
}
template <class T1, class T2>
T1 min(const T1& first, const T2& second) {
  return first <= T1(second) ? first : T1(second);
}
template <class T1, class T2>
T1 max(const T1& first, const T2& second) {
  return first >= T1(second) ? first : T1(second);
}
const long long INF = (long long)2e9;
const int MOD = (int)1e9 + 7;
const int MAXN = (int)1e5 + 10;
int n;
int a[MAXN];
int sum;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  if (sum != 0) {
    cout << "YES"
         << "\n";
    cout << 1 << "\n";
    cout << 1 << ' ' << n;
    return 0;
  }
  sum = 0;
  for (int i = 1; i <= n; i++) {
    sum += a[i];
    if (sum != 0) {
      cout << "YES"
           << "\n";
      cout << 2 << "\n";
      cout << 1 << ' ' << i << "\n";
      cout << i + 1 << ' ' << n;
      return 0;
    }
  }
  cout << "NO";
}
