#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const int MAXN = 100005;
int n, a[MAXN], b[MAXN];
void solve() {
  for (int i = 0; i < n; i++) {
    b[i] = a[i];
  }
  sort(b, b + n);
  int l = -1, r = -1;
  for (int i = 0; i < n; i++) {
    if (a[i] != b[i]) {
      l = i;
      break;
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    if (a[i] != b[i]) {
      r = i;
      break;
    }
  }
  if (l != -1) {
    int m = r - l + 1;
    for (int i = 0; i < m / 2; i++) {
      swap(a[l + i], a[r - i]);
    }
  }
  for (int i = 0; i < n; i++) {
    if (a[i] != b[i]) {
      printf("no\n");
      return;
    }
  }
  printf("yes\n");
  if (l == -1) {
    l = r = 0;
  }
  printf("%d %d\n", l + 1, r + 1);
}
int main() {
  while (scanf("%d", &n) == 1) {
    for (int i = 0; i < n; i++) {
      scanf("%d", a + i);
    }
    solve();
  }
}
