#include <bits/stdc++.h>
using namespace std;
const int inf = 0x7fffffff / 11.27;
int a[100005], b[100005];
int i, j, t, n, m, l, r, k, z, y, x;
inline void read(int &x) {
  x = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
}
int main() {
  read(n);
  for (i = 1; i <= n; i++) read(a[i]), b[i] = a[i];
  sort(b + 1, b + n + 1);
  for (i = 1; i <= n; i++)
    if (a[i] != b[i]) break;
  if (i > n) {
    printf("yes\n1 1");
    return 0;
  }
  l = i;
  for (i = n; i >= 1; i--)
    if (a[i] != b[i]) break;
  r = i;
  for (i = l; i <= r; i++)
    if (a[i] != b[r - (i - l)]) break;
  if (i > r)
    printf("yes\n%d %d\n", l, r);
  else
    printf("no\n");
  return 0;
}
