#include <bits/stdc++.h>
using namespace std;
int a[100000], b[100000], n, i, x, y;
int main() {
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    b[i] = a[i];
  }
  sort(b, b + n);
  for (i = 0; i < n; i++) {
    if (a[i] != b[i]) {
      x = i;
      break;
    }
  }
  for (i = n - 1; i >= 0; i--) {
    if (a[i] != b[i]) {
      y = i;
      break;
    }
  }
  reverse(a + x, a + y + 1);
  for (i = 0; i < n; i++) {
    if (a[i] != b[i]) {
      cout << "no";
      return 0;
    }
  }
  cout << "yes" << endl << x + 1 << " " << y + 1;
}
