#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, arr[100001], l = -1, r = -1;
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> arr[i];
  }
  arr[n] = 1000000001;
  for (i = 0; i < n; i++) {
    if (arr[i] > arr[i + 1] && l == -1) l = i;
    if (arr[i] < arr[i + 1] && l != -1 && r == -1) r = i;
  }
  sort(arr + l, arr + r + 1);
  for (i = 0; i < n; i++) {
    if (arr[i] > arr[i + 1]) {
      cout << "no" << endl;
      return 0;
    }
  }
  cout << "yes" << endl;
  if (l == -1 && r == -1)
    cout << 1 << ' ' << 1 << endl;
  else
    cout << l + 1 << ' ' << r + 1 << endl;
  return 0;
}
