#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
const long long MAX = 4e3 + 10;
const long long inf = 1e12;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  vector<long long> v(n), fix(n), uwu(n);
  for (long long i = 0; i < n; i++) {
    cin >> v[i];
    fix[i] = v[i];
  }
  sort(fix.begin(), fix.end());
  for (long long i = 0; i < n; i++) {
    if (fix[i] == v[i])
      uwu[i] = 0;
    else
      uwu[i] = 1;
  }
  long long cont = 0;
  long long back = 0;
  long long fis = 1, last = 1;
  for (long long i = 0; i < n; i++) {
    if (uwu[i] == 1) {
      fis = i + 1;
      break;
    }
  }
  for (long long i = 0; i < n; i++) {
    if (uwu[i]) last = i + 1;
  }
  reverse(v.begin() + fis - 1, v.begin() + last);
  if (fix == v)
    cout << "yes\n" << fis << " " << last << "\n";
  else
    cout << "no\n";
  return 0;
}
