#include <bits/stdc++.h>
using namespace std;
const int INF = 2e9 + 9;
int n, arr[100010], arr2[100010];
int main() {
  int flag = 1;
  int i, j, aux, a, b;
  scanf("%d", &n);
  for (int i = 0; i < (int)(n); i++) {
    scanf("%d", &arr[i]);
    arr2[i] = arr[i];
  }
  sort(arr2, arr2 + n);
  i = 0;
  while (arr[i] == arr2[i] && i < n) i++;
  j = n - 1;
  while (arr[j] == arr2[j] && j >= 0) j--;
  a = i + 1;
  b = j + 1;
  if (i != n) {
    while (i < j) {
      swap(arr[i], arr[j]);
      i++;
      j--;
    }
    for (int i = 0; i < (int)(n); i++) {
      if (arr[i] != arr2[i]) flag = 0;
    }
  } else {
    a = 1;
    b = 1;
  }
  if (flag) {
    printf("yes\n");
    printf("%d %d\n", a, b);
  } else
    printf("no\n");
  return 0;
}
