#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n];
  int found = 0;
  int l = 0;
  int r = 0;
  int direction = 0;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  for (int i = 1; i < n; i++) {
    if (direction == 0) {
      if (arr[i] < arr[i - 1]) {
        if (found == 0) {
          l = i - 1;
          direction = 1;
        } else {
          found = 2;
          break;
        }
      }
    } else {
      if (arr[i] > arr[i - 1] || i == n - 1) {
        if (arr[i] > arr[i - 1]) {
          r = i - 1;
        } else {
          r = i;
        }
        direction = 0;
        found = 1;
        for (int j = 0; j <= (r - l) / 2; j++) {
          int temp = arr[l + j];
          arr[l + j] = arr[r - j];
          arr[r - j] = temp;
        }
        i = 0;
      }
    }
  }
  if (found == 1) {
    if (direction == 0) {
      cout << "yes\n" << l + 1 << " " << r + 1;
    } else {
      cout << "no";
    }
  } else if (found == 0) {
    if (direction == 1) {
      cout << "yes\n" << l + 1 << " " << n;
    } else {
      cout << "yes\n" << 1 << " " << 1;
    }
  } else if (found == 2) {
    cout << "no";
  }
  return 0;
}
