#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  long long a[n];
  long long sorted[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    sorted[i] = a[i];
  }
  sort(sorted, sorted + n);
  long long i1 = 0, i2 = 0;
  for (long long i = 0; i < n; i++) {
    if (a[i] != sorted[i]) {
      i1 = i;
      break;
    }
  }
  for (long long i = n - 1; i >= 0; i--) {
    if (a[i] != sorted[i]) {
      i2 = i;
      break;
    }
  }
  long long d1 = i1, d2 = i2;
  long long t;
  for (int c = d1; c <= (i1 + i2) / 2; c++) {
    t = a[c];
    a[c] = a[d2];
    a[d2] = t;
    d2--;
  }
  bool flag = true;
  for (int i = 0; i < n; i++) {
    if (sorted[i] != a[i]) {
      flag = false;
      break;
    }
  }
  if (flag == true) {
    cout << "yes" << endl << i1 + 1 << " " << i2 + 1;
  } else {
    cout << "no";
  }
}
