#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  int l = 0, r = 0;
  for (int i = 1; i <= n - 1; i++) {
    if (a[i] < a[i - 1]) {
      r = i - 1;
      break;
    }
  }
  for (int i = n - 2; i >= 0; i--) {
    if (a[i] > a[i + 1]) {
      l = i + 1;
      break;
    }
  }
  if (l > r) {
    swap(l, r);
  }
  int i = l, j = r;
  while (i <= j) {
    swap(a[i], a[j]);
    i++;
    j--;
  }
  int check = 0;
  for (int i = 0; i < n - 1; ++i) {
    if (a[i] > a[i + 1]) {
      check = 1;
      break;
    }
  }
  if (check == 0) {
    cout << "yes" << endl;
    cout << l + 1 << ' ' << r + 1;
  } else
    cout << "no";
  return 0;
}
