#include <bits/stdc++.h>
using namespace std;
int a[100005];
int main() {
  int n, x = 1, y = 1;
  cin >> n;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i < n; i++) {
    if (a[i] > a[i + 1]) {
      x = i;
      break;
    }
  }
  for (int i = n; i >= 1; i--) {
    if (a[i] < a[i - 1]) {
      y = i;
      break;
    }
  }
  reverse(a + x, a + y + 1);
  int flag = 0;
  for (int i = 1; i < n; i++) {
    if (a[i] > a[i + 1]) {
      flag = 1;
      break;
    }
  }
  if (flag)
    cout << "no" << endl;
  else {
    cout << "yes" << endl << x << " " << y << endl;
  }
  return 0;
}
