#include <bits/stdc++.h>
using namespace std;
const int N = 1e5;
int a[N + 100];
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
    }
    int num = 0, pre = 1, last = 1, flag = 1;
    for (int i = 1; i <= n - 1; i++) {
      if (num > 1) {
        flag = 0;
        break;
      }
      if (a[i] > a[i + 1]) {
        pre = i;
        num++;
        for (int j = i + 1; j <= n; j++) {
          if (a[j] < a[j - 1]) {
            last = j;
            i = j;
          } else {
            i = j - 1;
            break;
          }
        }
      }
    }
    if (flag == 0) {
      printf("no\n");
    } else {
      for (int i = pre, j = last; i < j; i++, j--) {
        swap(a[i], a[j]);
      }
      for (int i = 1; i <= n - 1; i++) {
        if (a[i] > a[i + 1]) {
          flag = 0;
          break;
        }
      }
      if (flag)
        printf("yes\n%d %d\n", pre, last);
      else
        printf("no\n");
    }
  }
  return 0;
}
