#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> A(n);
  int a = -1, b = -1;
  for (int i = 0; i < n; i++) {
    cin >> A[i];
  }
  for (int i = 1; i < n; i++) {
    if (A[i] < A[i - 1]) {
      a = i - 1;
      break;
    }
  }
  for (int i = n - 2; i >= 0; i--) {
    if (A[i] > A[i + 1]) {
      b = i + 1;
      break;
    }
  }
  if (b == -1 && a == -1) {
    cout << "yes\n" << 1 << " " << 1 << "\n";
  } else {
    vector<int> B, B2;
    for (int i = 0; i < a; i++) B.push_back(A[i]);
    for (int i = b; i >= a; i--) {
      B.push_back(A[i]);
    }
    for (int i = b + 1; i < n; i++) {
      B.push_back(A[i]);
    }
    B2 = B;
    sort(B2.begin(), B2.end());
    if (B == B2) {
      cout << "yes\n" << a + 1 << " " << b + 1 << "\n";
    } else {
      cout << "no\n";
    }
  }
}
