#include <bits/stdc++.h>
using namespace std;
int const lim = 2e5;
vector<int> vec, pre;
map<int, int> to;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    vec.push_back(x);
    pre.push_back(x);
  }
  sort(vec.begin(), vec.end());
  int t = 1;
  for (int i = 0; i < n; i++) to[vec[i]] = t++;
  if (vec == pre) {
    puts("yes");
    puts("1 1");
    return 0;
  }
  for (int i = 0; i < n; i++) pre[i] = to[pre[i]];
  int l = 0, r = n - 1;
  while (l < n && pre[l] == l + 1) l++;
  while (r && pre[r] == r + 1) r--;
  vector<int> tem, pre1;
  for (int i = l; i <= r; i++) tem.push_back(pre[i]), pre1.push_back(pre[i]);
  sort(tem.begin(), tem.end());
  reverse(pre1.begin(), pre1.end());
  if (pre1 == tem) {
    puts("yes");
    cout << l + 1 << " " << r + 1 << endl;
  } else
    puts("no");
}
