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