#include <bits/stdc++.h>
using namespace std;
int main() {
  long int n, a[100005], i, l = 2, r, mx = -2, mn = 1000000009, j;
  cin >> n;
  a[n + 1] = 1000000009;
  a[0] = -1;
  r = n - 1;
  for (i = 1; i <= n; i++) {
    scanf("%ld", a + i);
  }
  if (n == 1) {
    cout << "yes\n1 1";
    return 0;
  }
  if (n == 2) {
    if (a[1] <= a[2])
      cout << "yes\n1 1";
    else
      cout << "yes\n1 2";
    return 0;
  }
  while (l <= n && a[l] >= a[l - 1]) l++;
  l--;
  while (r > 0 && a[r] <= a[r + 1]) r--;
  r++;
  if (l > r) {
    cout << "yes\n1 1";
    return 0;
  }
  if (l == r) {
    cout << "no";
    return 0;
  }
  for (j = l; j < r; j++) {
    if (a[j] < a[j + 1]) {
      cout << "no";
      return 0;
    }
  }
  if (a[l] <= a[r + 1] && a[r] >= a[l - 1]) {
    cout << "yes\n" << l << " " << r;
    return 0;
  } else {
    cout << "no";
    return 0;
  }
  return 0;
}
