#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int main() {
  int n;
  cin >> n;
  int a[N];
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  bool flag = true;
  for (int i = 1; i <= n; i++) {
    if (a[i - 1] > a[i]) {
      flag = false;
    }
  }
  if (flag == true) {
    cout << "yes" << endl;
    cout << 1 << " " << 1;
    return 0;
  }
  flag = true;
  for (int i = 1; i <= n; i++) {
    if (a[i + 1] > a[i]) {
      flag = false;
    }
  }
  if (flag == true) {
    cout << "yes" << endl;
    cout << 1 << " " << n;
    return 0;
  }
  int beg;
  flag = true;
  for (int i = 1; i <= n; i++) {
    if (a[i - 1] > a[i]) {
      beg = i - 2;
      break;
    }
  }
  for (int i = beg + 1; i <= n; i++) {
    if (a[i + 1] > a[i]) {
      flag = false;
    }
  }
  if (a[beg] > a[n]) {
    flag = false;
  }
  if (flag == true) {
    cout << "yes" << endl;
    cout << beg + 1 << " " << n;
    return 0;
  }
  flag = true;
  for (int i = 1; i <= n; i++) {
    if (a[i + 1] > a[i]) {
      beg = i;
      break;
    }
  }
  for (int i = beg + 1; i <= n; i++) {
    if (a[i - 1] > a[i]) {
      flag = false;
    }
  }
  if (a[1] > a[beg + 1]) {
    flag = false;
  }
  if (flag == true) {
    cout << "yes" << endl;
    cout << 1 << " " << beg;
    return 0;
  }
  flag = true;
  int last;
  for (int i = 1; i <= n; i++) {
    if (a[i] > a[i + 1]) {
      beg = i;
      last = beg;
      while (a[last] > a[last + 1]) {
        last++;
      }
      break;
    }
  }
  for (int i = 1; i <= beg; i++) {
    if (a[i - 1] > a[i]) {
      flag = false;
    }
  }
  for (int i = last + 1; i <= n; i++) {
    if (a[i - 1] > a[i]) {
      flag = false;
    }
  }
  if (a[beg] > a[last + 1] || a[beg - 1] > a[last]) {
    flag = false;
  }
  if (flag == true) {
    cout << "yes" << endl;
    cout << beg << " " << last;
    return 0;
  }
  cout << "no";
}
