#include <bits/stdc++.h>
using namespace std;
int N;
int A[100005], B[100005];
bool solve() {
  for (int i = 0; i < N; i++) {
    if (A[i] != B[i]) return false;
  }
  return true;
}
int main() {
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    scanf("%d", &A[i]);
    B[i] = A[i];
  }
  sort(A, A + N);
  int l = N - 1, r = 0;
  for (int i = 0; i < N; i++) {
    if (A[i] != B[i]) {
      l = min(i, l);
      r = max(i, r);
    }
  }
  if (l > r) l = r = 0;
  for (int i = l; i <= (l + r) / 2; i++) {
    swap(B[i], B[r - (i - l)]);
  }
  if (solve()) {
    puts("yes");
    printf("%d %d\n", l + 1, r + 1);
  } else {
    puts("no");
  }
  return 0;
}
