#include <bits/stdc++.h>
using namespace std;
void Reverse(int n, int arr1[], int l, int r) {
  int temp[n];
  for (int i = l, j = r; i <= r; i++, j--) temp[i] = arr1[j];
  for (int i = l; i <= r; i++) arr1[i] = temp[i];
}
int main() {
  int n;
  cin >> n;
  int arr1[n], arr2[n];
  for (int i = 0; i < n; i++) {
    cin >> arr1[i];
    arr2[i] = arr1[i];
  }
  sort(arr2, arr2 + n);
  int l = -1, r = -1;
  for (int i = 0; i < n; i++)
    if (arr1[i] != arr2[i]) {
      l = i;
      break;
    }
  for (int i = n - 1; i >= 0; i--)
    if (arr1[i] != arr2[i]) {
      r = i;
      break;
    }
  if (l == -1) return puts("yes"), puts("1 1"), 0;
  Reverse(n, arr1, l, r);
  for (int i = 0; i < n; i++)
    if (arr1[i] != arr2[i]) return puts("no"), 0;
  puts("yes");
  cout << min(l, r) + 1 << " " << max(l, r) + 1 << endl;
  return 0;
}
