#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long int a[n + 1];
  long long int b[n + 1];
  map<int, int> mp;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    b[i] = a[i];
  }
  sort(b + 1, b + n + 1);
  for (int i = 1; i <= n; i++) {
    mp[b[i]] = i;
  }
  for (int i = 1; i <= n; i++) {
    a[i] = mp[a[i]];
  }
  int l = -1;
  for (int i = 1; i < n; i++) {
    if (a[i] != i) {
      l = i;
      break;
    }
  }
  int r = -1;
  for (int i = n; i >= 1; i--) {
    if (a[i] != i) {
      r = i;
      break;
    }
  }
  if (l == -1 || r == -1) {
    cout << "yes" << endl;
    cout << 1 << " " << 1 << endl;
  } else {
    reverse(a + l, a + r + 1);
    int ok = true;
    for (int i = 1; i <= n; i++) {
      if (a[i] != i) {
        ok = false;
      }
    }
    if (ok) {
      cout << "yes" << endl;
      cout << l << " " << r << endl;
    } else {
      cout << "no" << endl;
    }
  }
  return 0;
}
