#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int found, start, end;
  found = start = end = 0;
  for (int i = 0; i < n - 1; i++) {
    if (a[i] > a[i + 1] && !found) {
      start = i;
      end = i + 1;
      found = 1;
    } else if (a[i] > a[i + 1] && found) {
      end++;
    } else if (a[i] < a[i + 1] && found) {
      break;
    }
  }
  vector<int> b(a);
  sort(b.begin(), b.end());
  vector<int> c;
  for (int i = 0; i < start; i++) {
    c.push_back(a[i]);
  }
  for (int i = end; i >= start; i--) {
    c.push_back(a[i]);
  }
  for (int i = end + 1; i < n; i++) {
    c.push_back(a[i]);
  }
  int f = 0;
  for (int i = 0; i < n; i++) {
    if (c[i] != b[i]) {
      f = 1;
      break;
    }
  }
  if (!f) {
    cout << "yes" << endl;
    cout << start + 1 << " " << end + 1;
  } else {
    cout << "no";
  }
  return 0;
}
