#include <bits/stdc++.h>
using namespace std;
const int maxn = 100;
int n, a[maxn];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> a[i];
  vector<pair<int, int>> ans;
  int cur = 0;
  while (cur < n && a[cur] == 0) cur += 1;
  if (cur == n) {
    cout << "NO\n";
    return 0;
  }
  ans.push_back({0, cur});
  for (int cur1 = cur + 1; cur1 < n; ++cur1) {
    if (a[cur1] == 0)
      ans.back().second += 1;
    else
      ans.push_back({cur1, cur1});
  }
  cout << "YES\n" << ans.size() << '\n';
  for (auto p : ans) cout << (p.first + 1) << ' ' << (p.second + 1) << '\n';
}
