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