#include <bits/stdc++.h>
using namespace std;
int abs(int a, int b) {
  if (a > b)
    return (a - b);
  else
    return (b - a);
}
int main() {
  int n;
  scanf("%d", &n);
  long long int ar[n], br[n];
  for (int i = 0; i < n; i++) {
    cin >> ar[i];
    br[i] = ar[i];
  }
  sort(br, br + n);
  int flag = 0;
  int i, l = -1, r = -1;
  for (i = 0, l = -1; i < n; i++) {
    if (ar[i] != br[i]) {
      l = i;
      break;
    }
  }
  if (l == -1) {
    printf("yes\n1 1");
  } else {
    for (i = l; i < n; i++) {
      if (ar[i] == br[l]) {
        r = i;
        break;
      }
    }
    flag = 0;
    for (i = r + 1; i < n; i++) {
      if (ar[i] != br[i]) {
        flag = 1;
        break;
      }
    }
    if (flag)
      printf("no\n");
    else {
      for (int j = l, i = r; j <= r; j++, i--) {
        if (ar[i] != br[j]) {
          flag = 1;
          break;
        }
      }
      if (flag)
        printf("no\n");
      else {
        printf("yes\n");
        if (r == n) r--;
        printf("%d %d\n", (l + 1), (r + 1));
      }
    }
  }
  return 0;
}
