#include <bits/stdc++.h>
using namespace std;
long long int a[123456], b[123456];
vector<long long int> v1, v2, v3;
map<long long int, long long int> mp;
map<string, long long int> mps;
map<char, long long int> mpc;
int main() {
  long long int f = 0, x = 0, l = 0, r = 0, n, i;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    b[i] = a[i];
  }
  sort(b, b + i);
  for (i = 0; i < n; i++) {
    if (a[i] != b[i]) {
      l = i + 1;
      break;
    }
  }
  for (i = n - 1; i >= 0; i--) {
    if (a[i] != b[i]) {
      r = i + 1;
      break;
    }
  }
  if (l == 0 && r == 0) {
    l = 1;
    r = 1;
    cout << "yes" << endl;
    cout << l << " " << r << endl;
    return 0;
  }
  long long int k = r - 1;
  for (i = l - 1; i <= r - 1; i++) {
    long long int aa = i;
    long long int bb = k;
    if (mp[bb] == 0 && mp[aa] == 0) {
      swap(a[i], a[k]);
      mp[aa] = 1;
      mp[bb] = 1;
      k--;
    }
  }
  for (i = 0; i < n; i++) {
    if (a[i] != b[i]) {
      cout << "no" << endl;
      return 0;
    }
  }
  cout << "yes" << endl;
  cout << l << " " << r << endl;
}
