#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ll t;
  t = 1;
  while (t--) {
    ll n;
    cin >> n;
    vector<ll> a(n), b(n);
    for (ll i = 0; i < n; i++) cin >> a[i];
    b = a;
    sort(b.begin(), b.end());
    ll ind1 = 0, ind2 = 0;
    for (ll i = 0; i < n; i++) {
      if (a[i] != b[i]) {
        ind1 = i;
        break;
      }
    }
    ll flag = 1;
    for (ll i = n - 1; i >= 0; i--) {
      if (a[i] != b[i]) {
        ind2 = i;
        break;
      }
    }
    for (ll i = ind1; i < ind2; i++) {
      if (a[i] < a[i + 1]) flag = 0;
    }
    if (flag) {
      cout << "yes\n" << ind1 + 1 << " " << ind2 + 1;
    } else
      cout << "no\n";
  }
  return 0;
}
