#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, arr[100001], i, j, k;
  cin >> n;
  for (i = 1; i <= n; i++) cin >> arr[i];
  i = 1;
  while (arr[i] < arr[i + 1] && i < n) i++;
  if (i == n) {
    cout << "yes\n";
    cout << 1 << " " << 1;
  } else {
    j = i;
    while (arr[j] > arr[j + 1] && j < n) j++;
    k = j;
    while (arr[k] < arr[k + 1] && k < n) k++;
    if (k != n)
      cout << "no";
    else {
      if (j == n) {
        if (i == 1) {
          cout << "yes\n";
          cout << i << " " << j;
        } else if (arr[i - 1] < arr[j]) {
          cout << "yes\n";
          cout << i << " " << j;
        } else
          cout << "no";
      } else {
        if (arr[i] < arr[j + 1]) {
          if (i == 1 || (i != 1 && arr[i - 1]) < arr[j]) {
            cout << "yes\n";
            cout << i << " " << j;
          } else
            cout << "no";
        } else
          cout << "no";
      }
    }
  }
  return 0;
}
