#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
void solve() {
  long long n;
  cin >> n;
  map<long long, long long> make_pair;
  vector<long long> v1(n);
  vector<long long> v2(n);
  for (int i = 0; i < n; i++) {
    cin >> v1[i];
    v2[i] = v1[i];
  }
  sort(v2.begin(), v2.end());
  int i = 0, i1 = 0, j = n - 1, j1 = n - 1;
  while (v1[i] == v2[i1] && i < n && i1 < n) {
    i++;
    i1++;
  }
  if (i == n) {
    cout << "yes"
         << "\n";
    cout << 1 << " " << 1 << "\n";
    return;
  }
  while (v1[j] == v2[j1] && j >= 0 && j1 >= 0) {
    j--;
    j1--;
  }
  for (int k = i; k < j; k++) {
    if (v1[k] < v1[k + 1]) {
      cout << "no"
           << "\n";
      return;
    }
  }
  cout << "yes"
       << "\n";
  cout << i1 + 1 << " " << j1 + 1 << "\n";
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  srand(chrono::high_resolution_clock::now().time_since_epoch().count());
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
