#include <bits/stdc++.h>
using namespace std;
long long int a[200001];
long long int h[200001];
int main() {
  int n;
  cin >> n;
  a[0] = INT32_MAX;
  a[n + 1] = 0;
  for (int i = 1; i < n + 1; i++) cin >> a[i];
  int i = 1, j = n;
  while (a[i] < a[i + 1]) i++;
  while (a[j] > a[j - 1]) j--;
  int px = i;
  int py = j;
  if (i == n || j == 1) {
    cout << "yes\n1 1\n";
  } else {
    reverse(a + i, a + j + 1);
    if (is_sorted(a + 1, a + n + 1)) {
      cout << "yes\n" << px << " " << py << "\n";
    } else {
      cout << "no\n";
    }
  }
  return 0;
}
