#include <bits/stdc++.h>
using namespace std;
int n, A[100005], B[100005], cev, flag, son, uc;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &A[i]);
    B[i] = A[i];
  }
  sort(B + 1, B + n + 1);
  for (int i = 1; i <= n; i++) {
    if (A[i] == B[i]) {
      uc++;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (A[i] != B[i]) {
      cev = i;
      break;
    }
  }
  for (int i = n; i >= cev; i--) {
    if (A[i] != B[i]) {
      flag = i;
      break;
    }
  }
  reverse(A + cev, A + flag + 1);
  for (int i = 1; i <= n; i++) {
    if (A[i] == B[i]) {
      son++;
    }
  }
  if (uc == n) {
    printf("yes\n1 1");
    return 0;
  }
  if (son == n) {
    printf("yes\n%d %d", cev, flag);
  } else {
    printf("no");
  }
  return 0;
}
