#include <bits/stdc++.h>
using namespace std;
int n, a[200005], last[200005], x, y, cnt;
struct nod {
  int val, pos;
} b[200005];
bool cmp(nod i, nod j) { return i.val < j.val; }
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) b[b[i].pos = i].val = a[i];
  sort(b + 1, b + n + 1, cmp);
  for (int i = 1; i <= n; i++) last[b[i].pos] = b[i].val - b[i - 1].val;
  for (int i = 1; i <= n; i++)
    if (((a[i] - a[i - 1]) < 0 ? -(a[i] - a[i - 1]) : (a[i] - a[i - 1])) !=
            last[i] &&
        ((a[i] - a[i - 1]) < 0 ? -(a[i] - a[i - 1]) : (a[i] - a[i - 1])) !=
            last[i - 1])
      (cnt++ ? y : x) = i;
  if (a[n] != b[n].val) cnt++, y = n + 1;
  if (cnt == 0) {
    cout << "yes\n1 1";
    return 0;
  } else if (cnt == 2) {
    cout << "yes\n" << x << " " << y - 1;
    return 0;
  } else {
    cout << "no";
    return 0;
  }
  return 0;
}
