#include <bits/stdc++.h>
using namespace std;
long long int arr[100005], a[100005];
int main() {
  ios::sync_with_stdio(false);
  long long int num, i, cnt, first, second, flag;
  cin >> num;
  for (i = 1; i <= num; i++) {
    cin >> arr[i];
    a[i] = arr[i];
  }
  sort(a, a + num + 1);
  cnt = 0;
  first = 1;
  second = 1;
  for (i = 1; i <= num; i++) {
    if (a[i] != arr[i]) {
      first = i;
      break;
    }
  }
  for (i = num; i > 0; i--) {
    if (a[i] != arr[i]) {
      second = i;
      break;
    }
  }
  reverse(arr + first, arr + second + 1);
  flag = 0;
  for (i = 1; i <= num; i++) {
    if (arr[i] != a[i]) {
      flag = 1;
      break;
    }
  }
  if (flag == 0) {
    cout << "yes" << endl;
    cout << first << " " << second << endl;
  } else
    cout << "no" << endl;
  return 0;
}
