#include <bits/stdc++.h>
int main() {
  int n, i, c = 0, p = 0, count = 0, small = 1, big = 1, temp;
  scanf("%d", &n);
  int ara[n];
  for (i = 1; i <= n; i++) {
    scanf("%d", &ara[i]);
    if (ara[i] < ara[i - 1] && i != 1 && c == 0) {
      small = i - 1;
      p = 1;
      c++;
    }
    if (ara[i] >= ara[i - 1] && i != 1 && c == 1 && p == 1) {
      big = i - 1;
      p = 0;
    }
    if (ara[i] > ara[i - 1] && i != 1) count = 1;
  }
  if (count == 0) {
    printf("yes\n");
    printf("%d %d", small, n);
  } else {
    if (small != 1 && big == 1) {
      if (ara[small - 1] <= ara[n]) {
        printf("yes\n");
        printf("%d %d", small, n);
        return 0;
      }
      printf("no");
      return 0;
    }
    for (i = small; i <= (big - small) / 2 + small; i++) {
      temp = ara[i];
      ara[i] = ara[big - i + small];
      ara[big - i + small] = temp;
    }
    count = 0;
    for (i = 1; i <= n; i++) {
      if (ara[i] < ara[i - 1] && i != 1) count = 1;
    }
    if (count == 1 && big != 1)
      printf("no");
    else {
      printf("yes\n");
      printf("%d %d", small, big);
    }
  }
}
