#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
inline void get_arr(vector<int> &arr, int n) {
  int a;
  for (int i = 0; i < n; i++) {
    cin >> a;
    arr.push_back(a);
  }
}
inline void print_arr(vector<int> &arr, int n) {
  for (int i = 0; i < n; i++) cout << arr[i] << " ";
  cout << "\n";
  ;
}
int main() {
  int n;
  cin >> n;
  vector<int> arr;
  get_arr(arr, n);
  auto L = is_sorted_until(arr.begin(), arr.end()) - arr.begin();
  if (L != 0) L--;
  auto R = n - 1;
  while (R > 0 && arr[R - 1] < arr[R]) {
    R--;
  }
  if (n == 1 || L == n - 1) {
    cout << "yes"
         << "\n";
    ;
    cout << 1 << " " << 1 << "\n";
    ;
    return (0);
  }
  reverse(arr.begin() + L, arr.begin() + R + 1);
  if (is_sorted(arr.begin(), arr.end())) {
    cout << "yes"
         << "\n";
    ;
    cout << L + 1 << " " << R + 1 << "\n";
    ;
  } else {
    cout << "no"
         << "\n";
    ;
  }
  return (0);
}
