#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  int b[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    b[i] = a[i];
  }
  sort(a, a + n);
  int left = 0, right = 0;
  for (int i = 0; i < n; i++) {
    if (b[i] != a[i]) {
      left = i;
      break;
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    if (b[i] != a[i]) {
      right = i;
      break;
    }
  }
  int i = left;
  int j = right;
  while (left < right) {
    swap(b[left], b[right]);
    left++;
    right--;
  }
  int flag = 1;
  for (int i = 0; i < n; i++) {
    if (a[i] != b[i]) {
      flag = 0;
      break;
    }
  }
  if (flag) {
    cout << "yes" << endl;
    cout << i + 1 << " " << j + 1;
  } else
    cout << "no";
}
