#include <bits/stdc++.h>
using namespace std;
void c_p_c() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
bool f(long long x, long long y) { return x > y; }
vector<long long> graph[100001];
long long vis[100001];
long long cc_size = 0;
void dfs(long long i) {
  vis[i] = 1;
  cc_size++;
  for (auto &it : graph[i]) {
    if (vis[it] == 0) dfs(it);
  }
}
long long countDivisors(long long n) {
  long long cnt = 0;
  for (long long i = 1; i <= sqrt(n); i++) {
    if (n % i == 0) {
      if (n / i == i)
        cnt++;
      else
        cnt = cnt + 2;
    }
  }
  return cnt;
}
bool isPrime(long long n) {
  long long i;
  for (i = 2; i <= sqrt(n); i++)
    if (n % i == 0) return false;
  return true;
}
int32_t main() {
  c_p_c();
  long long n;
  cin >> n;
  long long a[n];
  long long i;
  for (i = 0; i < n; i++) cin >> a[i];
  if (is_sorted(a, a + n))
    cout << "yes" << endl
         << "1"
         << " "
         << "1" << endl;
  else {
    long long low = 0;
    long long high = 0;
    long long t1 = 0, t2 = 0;
    for (i = 0; i < n - 1; i++) {
      if (a[i] > a[i + 1]) {
        high++;
      } else {
        if (high != 0) {
          t1 = i;
          t2 = t1 - high;
          high = 0;
          break;
        }
      }
    }
    if (high != 0) {
      t1 = i;
      t2 = t1 - high;
    }
    reverse(a + t2, a + t1 + 1);
    if (is_sorted(a, a + n))
      cout << "yes" << endl << t2 + 1 << " " << t1 + 1 << endl;
    else
      cout << "no";
  }
}
