#include <bits/stdc++.h>
using namespace std;
int n, arr[123112], kecil[123112], mark = -1;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &arr[i]);
    kecil[i] = 0;
  }
  arr[n + 1] = 1000000100;
  arr[0] = 0;
  for (int i = n - 1; i > 0; i--) {
    if (arr[i] > arr[i + 1]) {
      kecil[i] += (kecil[i + 1] + 1);
      if (mark != -1 && mark != i + 1) {
        printf("no\n");
        return 0;
      }
      mark = i;
    }
  }
  if (arr[mark] < arr[mark + kecil[mark] + 1] &&
      arr[mark + kecil[mark]] > arr[mark - 1]) {
    printf("yes\n");
    printf("%d %d\n", mark, mark + kecil[mark]);
  } else if (mark == -1) {
    printf("yes\n");
    printf("1 1\n");
  } else
    printf("no\n");
  return 0;
}
