#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  if (n == 1) {
    cout << "yes" << '\n';
    cout << 1 << " " << 1 << '\n';
    return;
  }
  vector<long long> v(n);
  for (long long i = 0; i < n; i++) {
    cin >> v[i];
  }
  long long l = 0;
  while (l + 1 < n && v[l] < v[l + 1]) {
    ++l;
  }
  long long r = l + 1;
  while (r < n && v[r] < v[r - 1]) {
    ++r;
  }
  reverse(v.begin() + l, v.begin() + r);
  for (long long i = 1; i < n; i++) {
    if (v[i] < v[i - 1]) {
      cout << "no" << '\n';
      return;
    }
  }
  cout << "yes" << '\n';
  cout << l + 1 << " " << r << '\n';
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
