#include <bits/stdc++.h>
using namespace std;
int arr[100005];
struct New {
  int x, id;
};
New nn[100005];
bool comp(New a, New b) { return a.x < b.x; }
int main() {
  int n;
  while (cin >> n) {
    for (int i = 0; i < n; i++) {
      cin >> arr[i];
      nn[i].x = arr[i];
      nn[i].id = i;
    }
    sort(nn, nn + n, comp);
    int i, j;
    for (i = 0; i < n; i++) {
      if (nn[i].id != i) break;
    }
    if (i == n) {
      cout << "yes" << endl << "1 1" << endl;
      return 0;
    }
    for (j = n - 1; j >= 0; j--) {
      if (nn[j].id != j) {
        break;
      }
    }
    int tt = i;
    int t = j;
    while (i <= j) {
      if (arr[i] != nn[t--].x) {
        break;
      }
      i++;
    }
    if (i == j + 1) {
      cout << "yes" << endl << tt + 1 << ' ' << j + 1 << endl;
    } else {
      cout << "no" << endl;
    }
  }
  return 0;
}
