#include <bits/stdc++.h>
using namespace std;
struct Dublu {
  int val, ind;
};
Dublu a[100005];
int n, frecv[100005], b[100005], gata, c[100005];
inline bool Sortare(const Dublu A, const Dublu B) { return A.val < B.val; }
void Citire() {
  int i;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i].val;
    c[i] = a[i].val;
    a[i].ind = i;
  }
  for (i = 2; a[i].val > a[i - 1].val && i <= n; i++)
    ;
  ;
  if (i > n) gata = 1;
  sort(a + 1, a + n + 1, Sortare);
  for (i = 1; i <= n; i++) {
    frecv[abs(a[i].ind - i)]++;
    b[i] = abs(a[i].ind - i);
  }
}
void Rezolvare() {
  int i, j;
  if (gata) {
    cout << "yes\n";
    cout << "1 1\n";
    return;
  }
  for (i = 1; i <= n && gata == 0; i++)
    if (frecv[i] != 0 && (frecv[i] > 2 || frecv[i] % 2 == 1)) gata = 1;
  if (gata)
    cout << "no\n";
  else {
    int maxim = 0, poz = 0;
    for (i = 1; i <= n; i++)
      if (maxim < b[i]) {
        maxim = b[i];
        poz = i;
      }
    i = poz;
    j = poz + maxim;
    while (i <= j) {
      swap(c[i], c[j]);
      i++;
      j--;
    }
    for (i = 2; c[i] > c[i - 1] && i <= n; i++)
      ;
    if (i > n) {
      cout << "yes\n";
      cout << poz << " " << poz + maxim << "\n";
    } else
      cout << "no\n";
  }
}
int main() {
  Citire();
  Rezolvare();
  return 0;
}
