#include <bits/stdc++.h>
using namespace std;
template <class T>
std::ostream& operator<<(std::ostream& os, const std::vector<T>& A) {
  for (const auto& x : A) os << x << ' ';
  return os;
}
int find_first_difference(vector<int>& array1, vector<int>& array2) {
  for (int i = 0; i < array1.size(); ++i) {
    if (array1[i] != array2[i]) return i;
  }
  return 0;
}
bool is_same_vector(vector<int>& array1, vector<int>& array2) {
  for (int i = 0; i < array1.size(); ++i) {
    if (array1[i] != array2[i]) return false;
  }
  return true;
}
int main() {
  int n, value;
  cin >> n;
  vector<int> array(n), array2(n);
  for (int i = 0; i < n; ++i) {
    cin >> value;
    array[i] = value;
    array2[i] = value;
  }
  sort(array.begin(), array.end());
  int start = find_first_difference(array, array2);
  value = array2[start];
  int end = start;
  for (int i = start + 1; i < n; ++i) {
    if (value > array2[i])
      value = array2[i];
    else
      break;
    end = i;
  }
  end++;
  reverse(array2.begin() + start, array2.begin() + end);
  if (is_same_vector(array, array2)) {
    cout << "yes" << endl;
    cout << start + 1 << " " << end;
  } else {
    cout << "no" << endl;
  }
  return 0;
}
