#include <bits/stdc++.h>
const long long mod = 1e9 + 7;
const int x = 1;
using namespace std;
long long qpow(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res *= a, res %= mod;
    a *= a;
    a %= mod;
    b >>= 1;
  }
  return res;
}
long long isprime(long long n) {
  int i;
  if (n == 2) return 1;
  if (n % 2 == 0) return 0;
  for (i = 3; i <= sqrt(n); i += 2)
    if (n % i == 0) return 0;
  return 1;
}
int main() {
  long long n;
  cin >> n;
  vector<int> v(n);
  vector<int> g(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    g[i] = v[i];
  }
  int l, r;
  sort((g).begin(), (g).end());
  bool tf = 0;
  for (int i = 0; i < n; i++) {
    tf |= (v[i] != g[i]);
  }
  if (tf == 0) {
    cout << "yes" << endl << "1 1";
    return 0;
  }
  for (int i = 0; i < n; i++) {
    if (v[i] != g[i]) {
      l = i;
      for (int j = l + 1; j < n; j++) {
        if (v[j] == g[l]) {
          r = j;
          goto k;
        }
      }
    }
  }
  r = n + 1;
k:
  reverse(v.begin() + l, v.begin() + r + 1);
  for (int i = 0; i < n; i++) {
    if (v[i] != g[i]) {
      cout << "no";
      return 0;
    }
  }
  cout << "yes" << endl << l + 1 << ' ' << r + 1 << endl;
  return 0;
}
