#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, l, r, c = 1, pos = 1;
  cin >> n;
  long long t;
  vector<long long> v1;
  for (int i = 0; i < n; ++i) {
    cin >> t;
    v1.push_back(t);
  }
  vector<long long> v2(v1.begin(), v1.end());
  sort(v2.begin(), v2.end());
  v1.push_back(numeric_limits<long long>::max());
  for (int i = 1; i <= n; ++i) {
    if (v1[i] < v1[i - 1]) {
      ++c;
      continue;
    } else {
      if (c > 1) {
        pos = i;
        break;
      }
    }
  }
  l = pos - c;
  r = pos;
  reverse(v1.begin() + l, v1.begin() + r);
  v1.pop_back();
  if (v1 == v2) {
    cout << "yes" << endl << l + 1 << " " << r << endl;
    return (0);
  }
  cout << "no" << endl;
}
