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