#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n + 1];
  int left = -1, right = -1;
  vector<int> v;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    v.push_back(arr[i]);
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < n; i++) {
    if (arr[i] != v[i]) {
      if (left == -1) left = i;
      right = i;
    }
  }
  if (left == -1 && right == -1)
    cout << "yes\n"
         << "1 1"
         << "\n";
  else {
    int j = left;
    int brr[n + 1];
    for (int i = right; i >= left; i--) {
      brr[j] = arr[i];
      j++;
    }
    for (int i = 0; i < n; i++) {
      if (i >= left && i <= right)
        continue;
      else
        brr[i] = arr[i];
    }
    int flag = 0;
    for (int i = 0; i < n; i++) {
      if (brr[i] != v[i]) {
        flag = 1;
        break;
      }
    }
    if (flag == 1)
      cout << "no\n";
    else {
      cout << "yes\n";
      cout << left + 1 << " " << right + 1;
    }
  }
  return 0;
}
