#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<long long> ar(n, 0);
  for (long long i = 0; i < n; i++) cin >> ar[i];
  vector<long long> tmp;
  tmp = ar;
  bool flag = true;
  long long idx1, idx2;
  sort(tmp.begin(), tmp.end());
  if (ar == tmp) {
    cout << "yes\n" << 1 << " " << 1;
    return 0;
  }
  for (int i = 0; i < n - 1; i++) {
    long long j, cnt;
    if (ar[i] > ar[i + 1]) {
      j = i + 1;
      cnt = 2;
      while (ar[j] > ar[j + 1] && j < n - 1) {
        j++;
        cnt++;
      }
      reverse(ar.begin() + i, ar.begin() + i + cnt);
      idx1 = i;
      idx2 = j;
      break;
    }
  }
  if (ar != tmp)
    cout << "no\n";
  else {
    cout << "yes\n" << idx1 + 1 << " " << idx2 + 1;
  }
  return 0;
}
