#include <bits/stdc++.h>
using namespace std;
const int maz = 1e5;
long long int arr[maz + 2];
long long int srt[maz + 2];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
    srt[i] = arr[i];
  }
  sort(srt, srt + n + 1);
  int r = 1, l = 1;
  for (int i = 1; i <= n; i++) {
    if (srt[i] != arr[i]) {
      r = i;
      break;
    }
  }
  for (int i = n; i >= 1; i--) {
    if (srt[i] != arr[i]) {
      l = i;
      break;
    }
  }
  int x = r, y = l;
  while (x < y) {
    swap(arr[x], arr[y]);
    x++;
    y--;
  }
  bool iSort = 1;
  for (int i = 1; i <= n; i++)
    if (arr[i] != srt[i]) {
      iSort = 0;
      break;
    }
  if (iSort)
    cout << "yes" << endl << r << " " << l;
  else
    cout << "no";
  return 0;
}
