#include <bits/stdc++.h>
using namespace std;
int a[100001];
bool IsSorted(int *arr, int n) {
  for (int i = 1; i < n; i++) {
    if (arr[i] > arr[i + 1]) {
      return false;
    }
  }
  return true;
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  int s, e;
  s = 1;
  while (a[s] <= a[s + 1] && s < n) s++;
  e = s;
  while (a[e] >= a[e + 1] && e < n) e++;
  reverse(a + s, a + e + 1);
  if (IsSorted(a, n)) {
    cout << "yes" << endl;
    cout << s << " " << e << endl;
  } else
    cout << "no" << endl;
}
