#include <bits/stdc++.h>
using namespace std;
int arr[100005];
int main() {
  int n, i;
  cin >> n;
  for (i = 0; i < n; i++) cin >> arr[i];
  i = 0;
  for (; i < n - 1; i++) {
    if (arr[i] > arr[i + 1]) break;
  }
  if (i == n - 1) {
    cout << "yes" << endl
         << "1 "
         << "1";
    return 0;
  }
  int l = i;
  i++;
  for (; i < n - 1; i++) {
    if (arr[i] < arr[i + 1]) break;
  }
  if (i == n - 1) {
    if (l == 0) {
      cout << "yes\n";
      cout << "1"
           << " " << n;
    } else if (arr[l - 1] <= arr[i]) {
      cout << "yes\n";
      cout << l + 1 << " " << n;
    } else
      cout << "no";
    return 0;
  }
  int r = i;
  i++;
  for (; i < n - 1; i++) {
    if (arr[i] > arr[i + 1]) break;
  }
  if (i == n - 1) {
    if (l == 0 && arr[r + 1] >= arr[l]) {
      cout << "yes\n";
      cout << l + 1 << " " << r + 1;
    } else if (arr[l - 1] <= arr[r] && arr[r + 1] >= arr[l]) {
      cout << "yes\n";
      cout << l + 1 << " " << r + 1;
    } else {
      cout << "no";
    }
    return 0;
  }
  cout << "no";
  return 0;
}
