#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  vector<long long int> v(n), vv(n);
  for (long long int i = 0; i < n; i++) {
    cin >> v[i];
    vv[i] = v[i];
  }
  sort(v.begin(), v.begin() + n);
  long long int l = -1, r;
  for (long long int i = 0; i < n; i++) {
    if (v[i] != vv[i] and l == -1) l = i;
    if (v[i] != vv[i]) r = i;
  }
  if (l == -1) {
    l = 0;
    r = 0;
  }
  long long int mx = vv[l];
  long long int ok = 1;
  for (long long int i = l; i <= r; i++) {
    if (mx < vv[i]) {
      ok = 0;
      break;
    } else {
      mx = vv[i];
    }
  }
  if (ok) {
    cout << "yes" << endl;
    l++;
    r++;
    cout << l << " " << r << endl;
  } else {
    cout << "no" << endl;
  }
}
