#include <bits/stdc++.h>
template <class T>
typename T::value_type arr_sum(const T& v, int n) {
  typename T::value_type sum = 0;
  for (int i = 0; i < n; ++i) sum += v[i];
  return sum;
}
template <class T>
long long arr_count(const T& v, int n, int t) {
  long long count = 0;
  for (int i = 0; i < n; ++i) count += (v[i] == t);
  return count;
}
template <class T>
typename T::value_type arr_maxi(const T& v, int n) {
  typename T::value_type maxi = 0;
  for (int i = 1; i < n; ++i)
    if (v[maxi] < v[i]) maxi = i;
  return maxi;
}
template <class T>
typename T::value_type arr_mini(const T& v, int n) {
  typename T::value_type mini = 0;
  for (int i = 1; i < n; ++i)
    if (v[mini] > v[i]) mini = i;
  return mini;
}
template <class T>
typename T::value_type arr_max(const T& v, int n) {
  typename T::value_type max = v[0];
  for (int i = 1; i < n; ++i)
    if (max < v[i]) max = v[i];
  return max;
}
template <class T>
typename T::value_type arr_min(const T& v, int n) {
  typename T::value_type min = v[0];
  for (int i = 1; i < n; ++i)
    if (min > v[i]) min = v[i];
  return min;
}
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; ++i) cin >> v[i];
  ;
  int i = 0;
  while (i < v.size() - 1 && v[i] < v[i + 1]) {
    ++i;
  }
  if (i == v.size() - 1) {
    cout << "yes" << endl;
    cout << "1 1" << endl;
    return 0;
  }
  int t = v.size() - 1;
  while (t >= 1 && v[t - 1] < v[t]) {
    --t;
  }
  vector<int> a = v;
  reverse(a.begin() + i, a.begin() + t + 1);
  sort(v.begin(), v.end());
  if (a == v) {
    cout << "yes" << endl;
    cout << i + 1 << " " << t + 1 << endl;
    return 0;
  }
  cout << "no" << endl;
}
