#include <bits/stdc++.h>
using namespace std;
long long i, n, t = 1, a[100005], x, y, m, p;
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (i = 2; i <= n; i++) {
    if (a[i] > a[i - 1]) {
      t++;
    }
  }
  if (t == n) {
    cout << "yes" << endl << "1 1";
    return 0;
  }
  for (i = 2; i <= n; i++) {
    if (a[i] < a[i - 1]) {
      x = i;
      break;
    }
  }
  for (i = x; i <= n; i++) {
    if (a[i] > a[i - 1]) {
      y = i;
      break;
    }
    if (y == 0) {
      y = n + 1;
    }
  }
  if (x == 2 && y == 0) {
    cout << "yes" << endl << 1 << " " << n;
    return 0;
  }
  sort(a + x - 1, a + y);
  for (i = 1; i <= n; i++) {
    if (a[i] < a[i - 1]) {
      cout << "no";
      return 0;
    }
  }
  cout << "yes" << endl << x - 1 << " " << y - 1;
}
