#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, k, cnt = 0, m, a, b, start = -1, stop = -1;
  cin >> n;
  int arr[n];
  for (i = 0; i < n; i++) {
    cin >> arr[i];
  }
  for (i = 0; i < n - 1; i++) {
    if (arr[i] > arr[i + 1]) {
      start = i;
      cnt++;
      while (i < n - 1 && arr[i] > arr[i + 1]) {
        i++;
      }
      stop = i;
    }
    if (start != -1 && stop != -1 && stop != n - 1) {
      if (arr[start] > arr[stop + 1]) {
        cnt++;
      }
    }
  }
  if (cnt == 0) {
    cout << "yes" << endl << "1 1";
  } else if (cnt == 1) {
    if (start != 0) {
      if (stop != n - 1) {
        if (arr[stop] > arr[start - 1]) {
          cout << "yes" << endl << start + 1 << " " << stop + 1;
          return 0;
        } else {
          cout << "no";
          return 0;
        }
      }
      if (arr[stop] > arr[start - 1]) {
        cout << "yes" << endl << start + 1 << " " << stop + 1;
        return 0;
      } else {
        cout << "no";
        return 0;
      }
    }
    cout << "yes" << endl << start + 1 << " " << stop + 1;
  } else {
    cout << "no";
  }
  return 0;
}
