#include <bits/stdc++.h>
using namespace std;
bool issorted(int* T, int n) {
  for (int i = 1; i < n; ++i)
    if (T[i] < T[i - 1]) return false;
  return true;
}
int main() {
  int n;
  cin >> n;
  int T[n], er[n], help[n];
  for (int i = 0; i < n; ++i) {
    cin >> T[i];
    help[i] = er[i] = T[i];
  }
  if (issorted(T, n)) {
    cout << "yes\n1 1\n";
    return 0;
  }
  sort(er, er + n);
  for (int i = 0; i < n; ++i) help[i] -= er[i];
  int i = 0, j = n - 1;
  while (help[i] == 0) i++;
  while (help[j] == 0) j--;
  for (int s = i; s <= (i + j) / 2; ++s) swap(T[s], T[j - s + i]);
  bool tak = issorted(T, n);
  cout << (tak ? "yes\n" : "no\n");
  if (tak) cout << i + 1 << " " << j + 1 << endl;
}
