#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, j, t, n, l, x, y, f = 0, h = 1, g = 1;
  cin >> n;
  x = 0, y = n;
  int a[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  if (is_sorted(a, a + n)) {
    x = y = 0;
    f = 1;
  } else {
    for (i = 1; i < n; i++) {
      if (a[i] < a[i - 1] && g) {
        x = i - 1;
        g--;
      }
      if (a[i] > a[i - 1] && h && !g) {
        y = i - 1;
        h--;
      }
    }
    if (y == n) {
      y--;
    }
    reverse(a + x, a + y + 1);
    if (is_sorted(a, a + n)) {
      f = 1;
    }
  }
  if (!f) {
    cout << "no" << endl;
  } else {
    cout << "yes" << endl;
    if (y == n) {
      y--;
    }
    cout << x + 1 << " " << y + 1 << endl;
  }
}
