#include <bits/stdc++.h>
using namespace std;
void solution();
int main() {
  ios::sync_with_stdio(false);
  solution();
  return EXIT_SUCCESS;
}
long long n, a[100000];
bool test(long long l, long long r) {
  l = max(0ll, l);
  r = min(n, r);
  reverse(a + l, a + r);
  if (is_sorted(a, a + n)) {
    cout << "yes" << endl;
    cout << l + 1 << " " << r << endl;
    return true;
  }
  reverse(a + l, a + r);
  return false;
}
void solve() {
  if (is_sorted(a, a + n)) {
    cout << "yes" << endl << 1 << " " << 1 << endl;
    return;
  }
  long long l = -1, r = -1;
  for (long long i = 1; i < n; ++i) {
    if (l == -1 && a[i] < a[i - 1]) {
      l = i;
    }
    if (l != -1 && a[i] > a[i - 1]) {
      r = i;
      break;
    }
  }
  if (l == -1) l = 0;
  if (r == -1) r = n;
  if (test(0, n) || test(l, r) || test(l - 1, r + 1) || test(l - 1, r) ||
      test(l, r + 1))
    return;
  cout << "no" << endl;
}
void solution() {
  for (; cin >> n;) {
    for (long long i = 0; i < n; ++i) cin >> a[i];
    solve();
    break;
  }
}
