#include <bits/stdc++.h>
using namespace std;
bool sv[1000000];
void fillsv(int64_t x) {
  memset(sv, true, sizeof(sv));
  sv[0] = sv[1] = false;
  for (int64_t p = 2; p * p <= x; p++)
    if (sv[p] == true)
      for (int64_t i = p * p; i <= x; i += p) sv[i] = false;
}
inline int64_t max(int64_t a, int64_t b) { return (a > b) ? a : b; }
inline int64_t min(int64_t a, int64_t b) { return (a < b) ? a : b; }
inline int64_t max3(int64_t a, int64_t b, int64_t c) {
  return max(a, max(b, c));
}
inline int64_t min3(int64_t a, int64_t b, int64_t c) {
  return min(a, min(b, c));
}
int64_t gcd(int64_t a, int64_t b) { return (a % b == 0) ? b : gcd(b, a % b); }
int64_t pow3(int64_t a, int64_t b, int64_t m = 1000000007) {
  int64_t res = 1;
  while (b > 0) {
    if (b & 1) res = (res * a) % m;
    a = (a * a) % m;
    b >>= 1;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  fillsv(1000000);
  int64_t t = 1;
  while (t--) {
    int64_t n;
    cin >> n;
    int64_t a[n];
    for (int64_t i = 0; i < n; i++) cin >> a[i];
    int64_t l = -1, r = -1;
    for (int64_t i = 1; i < n; i++) {
      if (a[i] < a[i - 1]) {
        l = i - 1;
        break;
      }
    }
    if (l == -1) l = 0;
    for (int64_t i = n - 2; i > -1; i--) {
      if (a[i] > a[i + 1]) {
        r = i + 1;
        break;
      }
    }
    if (r == -1) r = n - 1;
    reverse(a + l, a + r + 1);
    if (is_sorted(a, a + n))
      cout << "yes" << endl << l + 1 << " " << r + 1;
    else if (l == 0 && r == n - 1) {
      reverse(a, a + n);
      if (is_sorted(a, a + n))
        cout << "yes" << endl << l + 1 << " " << l + 1;
      else
        cout << "no";
    } else
      cout << "no";
  }
  return 0;
}
