#include <bits/stdc++.h>
using namespace std;
int n, parent[2005], ans = 0;
int main() {
  long arr[100005];
  cin >> n;
  for (int i = 0; i < n; i++) cin >> arr[i];
  int x = -1;
  for (int i = 0; i < n - 1; i++) {
    if (arr[i] > arr[i + 1]) {
      x = i;
      break;
    }
  }
  if (x == -1) {
    cout << "yes" << endl << "1 1";
    return 0;
  }
  int i = x + 1;
  while (arr[i] < arr[x] && i < n) i++;
  int y = i;
  int flag = 0;
  for (int i = x; i < y - 1; i++)
    if (arr[i] <= arr[i + 1]) flag = 1;
  int z = -1;
  for (int i = 0; i < n - 1; i++) {
    if (i >= x && i < y)
      continue;
    else if (i == x - 1 && arr[i] > arr[y - 1])
      z = i;
    if (arr[i] > arr[i + 1]) z = i;
  }
  if (z == -1 && flag == 0)
    cout << "yes" << endl << x + 1 << " " << y;
  else
    cout << "no";
}
