#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<long int> v(n), b(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    b[i] = v[i];
  }
  sort(b.begin(), b.end());
  int i = 0, start, end;
  while (v[i + 1] > v[i]) i++;
  start = i;
  if (start >= n) {
    cout << "yes" << endl;
    cout << 1 << " " << 1 << endl;
    return 0;
  }
  while (v[i + 1] < v[i] && i + 1 < n) i++;
  end = i;
  if (end < n)
    reverse(v.begin() + start, v.begin() + end + 1);
  else
    reverse(v.begin() + start, v.begin() + end);
  for (int i = 0; i < n; i++) {
    if (v[i] != b[i]) {
      cout << "no" << endl;
      return 0;
    }
  }
  cout << "yes" << endl;
  if (end < n)
    cout << start + 1 << " " << end + 1 << endl;
  else
    cout << start + 1 << " " << end << endl;
  return 0;
}
