#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int l = 0, r = 0;
  for (int i = 0; i < n - 1; i++) {
    if (a[i] > a[i + 1]) {
      l = i;
      break;
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    if (a[i] < a[i - 1]) {
      r = i;
      break;
    }
  }
  reverse(a.begin() + l, a.begin() + r + 1);
  for (int i = 1; i < n; i++) {
    if (a[i] < a[i - 1]) {
      puts("no");
      return 0;
    }
  }
  cout << "yes" << endl << l + 1 << " " << r + 1;
  return 0;
}
