#include <bits/stdc++.h>
using namespace std;
int a[100010];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int p = -1;
  for (int i = 0; i < n - 1; i++) {
    if (a[i] > a[i + 1]) {
      p = i;
      break;
    }
  }
  if (p == -1) {
    cout << "yes" << endl;
    cout << "1 1" << endl;
    return 0;
  }
  int q = n - 1;
  for (int i = p; i + 1 < n; i++) {
    if (a[i] < a[i + 1]) {
      q = i;
      break;
    }
  }
  reverse(a + p, a + q + 1);
  if (is_sorted(a, a + n)) {
    cout << "yes" << endl;
    cout << p + 1 << " " << q + 1 << endl;
  } else {
    cout << "no" << endl;
  }
  return 0;
}
