#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, i, p, j, s, e;
  cin >> n;
  long long int ar[n];
  for (i = 0; i < n; i++) cin >> ar[i];
  j = 0;
  if (ar[j] > ar[j + 1])
    s = j;
  else {
    int f = 0;
    for (i = 0; i < n && f == 0; i++) {
      if (ar[i] > ar[i + 1]) {
        s = i;
        f = 1;
      }
    }
    if (f == 0) {
      cout << "yes" << endl;
      cout << "1 1" << endl;
      return 0;
    }
  }
  int f = 0;
  int t = 0;
  for (i = s + 1; i < n && t == 0; i++) {
    if (ar[i] > ar[i - 1]) {
      t = 1;
      e = i;
    }
  }
  if (t == 0) e = n;
  sort(ar + s, ar + e);
  for (i = 0; i < n - 1; i++) {
    if (ar[i] > ar[i + 1]) {
      cout << "no" << endl;
      return 0;
    }
  }
  cout << "yes" << endl;
  cout << s + 1 << " " << e << endl;
}
