#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  vector<long long> v1(n);
  for (auto &a : v1) cin >> a;
  vector<long long> v2;
  bool ok1 = 0;
  for (long long i = 0; i < n - 1; i++) {
    if (v1[i] > v1[i + 1]) {
      ok1 = 1;
      v2.push_back(i);
      if (i + 1 == n - 1) {
        v2.push_back(i + 1);
        break;
      }
      if (v1[i + 1] < v1[i + 2] && (i + 2) < n) {
        v2.push_back(i + 1);
        break;
      }
    }
  }
  if (ok1 == 1) {
    long long l = v2[v2.size() - 1];
    long long r = v2[0];
    bool ok = 1;
    reverse(v1.begin() + v2[0], v1.begin() + v2[v2.size() - 1] + 1);
    for (long long i = 0; i < n - 1; i++) {
      if (v1[i] > v1[i + 1]) ok = 0;
    }
    if (ok == 1) {
      cout << "yes" << endl;
      cout << r + 1 << " " << l + 1 << endl;
    } else
      cout << "no" << endl;
  } else {
    cout << "yes" << endl;
    cout << "1"
         << " "
         << "1" << endl;
  }
}
signed main() {
  solve();
  return 0;
}
