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