#include <bits/stdc++.h>
using namespace std;
bool check_seg(long long int n, long long int arr1[], long long int arr2[]);
int main() {
  long long int n;
  long long int num1[100000], num2[100000];
  cin >> n;
  int star = 1;
  int en = 1;
  for (int i = 0; i < n; i++) {
    cin >> num1[i];
  }
  for (int i = 0; i < n; i++) {
    num2[i] = num1[i];
  }
  for (int i = 0; i < n - 1; i++) {
    if (num1[i] > num1[i + 1]) {
      star = i + 1;
      break;
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    if (num1[i] < num1[i - 1]) {
      en = i + 1;
      break;
    }
  }
  sort(num2, num2 + n);
  if (check_seg(n, num1, num2)) {
    cout << "yes\n";
    cout << star << " " << en << endl;
  } else {
    cout << "no\n";
  }
  return 0;
}
bool check_seg(long long int n, long long int arr1[], long long int arr2[]) {
  int star, en;
  for (int i = 0; i < n; i++) {
    if (arr1[i] > arr1[i + 1]) {
      star = i;
      break;
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    if (arr1[i] < arr1[i - 1]) {
      en = i;
      break;
    }
  }
  while (star < en) {
    swap(arr1[star], arr1[en]);
    star++;
    en--;
  }
  for (int i = 0; i < n; i++) {
    if (arr1[i] != arr2[i]) {
      return false;
    }
  }
  return true;
}
