#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  vector<long long int> a;
  for (long long int i = 0; i < n; i++) {
    long long int m;
    cin >> m;
    a.push_back(m);
  }
  long long int p = -1, q = -1;
  for (long long int i = 0; i < n - 1; i++) {
    if (a[i] > a[i + 1]) {
      p = i;
      break;
    }
  }
  for (long long int i = n - 1; i >= 1; i--) {
    if (a[i] < a[i - 1]) {
      q = i;
      break;
    }
  }
  if (p == -1 and q == -1) {
    cout << "yes" << endl;
    cout << 1 << " " << 1 << endl;
  } else {
    long long int z = 0;
    vector<long long int> v;
    for (long long int i = 0; i < p; i++) {
      v.push_back(a[i]);
    }
    for (long long int i = q; i >= p; i--) {
      v.push_back(a[i]);
    }
    for (long long int i = q + 1; i < n; i++) {
      v.push_back(a[i]);
    }
    for (long long int i = 0; i < n - 1; i++) {
      if (v[i] > v[i + 1]) {
        z = 1;
        break;
      }
    }
    if (z == 0) {
      cout << "yes" << endl;
      cout << p + 1 << " " << q + 1 << endl;
      ;
    } else
      cout << "no" << endl;
  }
}
