#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, i, k;
  cin >> n;
  vector<int> v, vv;
  while (n--) {
    cin >> x;
    v.push_back(x);
  }
  vv = v;
  sort(vv.begin(), vv.end());
  if (v == vv) {
    cout << "yes\n1 1";
    return 0;
  }
  for (i = 0; i < v.size() - 1; i++)
    if (v[i] > v[i + 1]) break;
  for (k = i + 1; k < v.size() - 1; k++)
    if (v[k + 1] > v[k]) break;
  reverse(v.begin() + i, v.begin() + k + 1);
  if (v == vv) {
    cout << "yes\n" << i + 1 << " " << k + 1;
    return 0;
  }
  cout << "no";
  return 0;
}
