#include <bits/stdc++.h>
using namespace std;
const int N = 123456;
int a[N], b[N];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", a + i), b[i] = a[i];
  sort(a, a + n);
  int l = -1, r = -1;
  for (int i = 0; i < n; ++i)
    if (a[i] != b[i]) (l == -1 ? l : r) = i;
  if (l == -1 || r == -1) return 0 * printf("yes\n1 1\n");
  for (int i = l, j = r; i < j; ++i, --j) swap(b[i], b[j]);
  for (int i = 0; i < n; ++i)
    if (a[i] != b[i]) return 0 * puts("no");
  printf("yes\n%d %d\n", l + 1, r + 1);
  return 0;
}
