#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[100000];
  cin >> n;
  int ma = INT_MIN;
  int mi = INT_MAX;
  int l = 1;
  int r = 1;
  bool ans = false;
  bool ok = true;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 2; i <= n; i++) {
    if (a[i - 1] > a[i]) {
      l = i - 1;
      break;
    }
  }
  for (int i = n - 1; i >= 1; i--) {
    if (a[i + 1] < a[i]) {
      r = i + 1;
      break;
    }
  }
  if (l == 1 && r == 1) {
    cout << "yes"
         << "\n"
         << "1"
         << " "
         << "1";
    return 0;
  }
  int s = l;
  int e = r;
  while (s <= e) {
    swap(a[s], a[e]);
    s++;
    e--;
  }
  if (l > r) {
    swap(l, r);
  }
  for (int i = 1; i < n; i++) {
    if (a[i] < a[i + 1]) {
      ans = true;
    } else {
      ans = false;
      break;
    }
  }
  if (ans == true) {
    cout << "yes"
         << "\n";
    cout << l << " " << r;
  } else {
    cout << "no";
  }
}
