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