#include <bits/stdc++.h>
int main() {
  int n;
  std::cin >> n;
  std::vector<int> v(n);
  for (int i = 0; i < n; i++) {
    std::cin >> v[i];
  }
  std::vector<int> t = v;
  std::sort(t.begin(), t.end());
  if (t == v) {
    std::cout << "yes" << '\n';
    std::cout << 1 << ' ' << 1 << '\n';
    return 0;
  }
  int i, j;
  i = 0;
  while (v[i] == t[i]) i++;
  j = (int)(v.size() - 1);
  while (v[j] == t[j]) j--;
  int s, e;
  s = i, e = j;
  while (i < j) {
    std::swap(v[i], v[j]);
    i++, j--;
  }
  if (v == t) {
    std::cout << "yes" << '\n';
    std::cout << s + 1 << ' ' << e + 1 << '\n';
  } else {
    std::cout << "no" << '\n';
  }
  return 0;
}
