#include <bits/stdc++.h>
using namespace std;
const double pi = 2 * acos(0);
const long long N = 1e9 + 5;
long long j, t, i, n, x, y;
int main() {
  cin >> x;
  vector<long long> v(x);
  for (int i = 0; i < x; i++) {
    cin >> v[i];
  }
  if (is_sorted(v.begin(), v.end())) {
    cout << "yes"
         << "\n"
         << 1 << " " << 1;
    return 0;
  }
  n = 0;
  t = 0;
  for (int i = 0; i < x; i++) {
    if (v[i] > v[i + 1] && t == 0) {
      n = i;
      t = 1;
    } else if ((v[i] < v[i + 1] || i == x - 1) && t == 1) {
      y = i;
      break;
    }
  }
  sort(v.begin() + n, v.begin() + y + 1);
  if (is_sorted(v.begin(), v.end())) {
    cout << "yes"
         << "\n"
         << n + 1 << " " << y + 1;
    return 0;
  }
  cout << "no";
}
