#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int start, end;
  bool count = false;
  for (int i = 1; i < n; i++) {
    if (a[i] < a[i - 1]) {
      if (!count) {
        start = i - 1;
        while (a[i] <= a[i - 1] && i < n) {
          i++;
        }
        end = i - 1;
        count = true;
        i--;
        if (a[end] < a[start - 1] && start != 0) {
          cout << "no";
          return 0;
        }
        a[i] = a[start];
      } else {
        cout << "no";
        return 0;
      }
    }
  }
  cout << "yes" << endl;
  if (count)
    cout << start + 1 << " " << end + 1;
  else
    cout << "1 1" << endl;
  return 0;
}
