#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n], flagstart = 0, start = 0, end = 0, flagstop = 0, flagno = 0;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (i != 0 && arr[i] < arr[i - 1] && flagstart == 0 && flagstop == 0) {
      flagstart = 1;
      start = i - 1;
    }
    if (flagstart == 1 && i != 0 && arr[i] > arr[i - 1] && flagstop == 0) {
      flagstop = 1;
      end = i - 1;
    }
    if (i != 0 && flagstart == 1 && flagstop == 1 && arr[i] < arr[i - 1]) {
      flagno = 1;
    }
  }
  if (flagstart == 1 && arr[n - 1] < arr[n - 2] && flagstop == 0) {
    flagstop = 1;
    end = n - 1;
  }
  if (flagno == 1) {
    cout << "no";
    return 0;
  } else if (flagstart == 0) {
    cout << "yes" << endl << "1 1";
  } else if (start == 0 && end == n - 1) {
    cout << "yes" << endl << start + 1 << " " << end + 1;
  } else if (arr[start] <= arr[end + 1] && start == 0) {
    cout << "yes" << endl << start + 1 << " " << end + 1;
  } else if (arr[end] > arr[start - 1] && end == n - 1) {
    cout << "yes" << endl << start + 1 << " " << end + 1;
  } else if (arr[start] <= arr[end + 1] && arr[end] > arr[start - 1]) {
    cout << "yes" << endl << start + 1 << " " << end + 1;
  } else {
    cout << "no";
  }
  return 0;
}
