#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, f = 0, l = 0;
  cin >> n;
  int a[n], b[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    b[i] = a[i];
  }
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    if (a[i] != b[i]) {
      f = i;
      break;
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    if (a[i] != b[i]) {
      l = i;
      break;
    }
  }
  for (int i = f, j = l; i <= l; i++, j--) {
    if (a[i] != b[j]) {
      cout << "no";
      return 0;
    }
  }
  cout << "yes" << endl << f + 1 << " " << l + 1;
}
