#include <bits/stdc++.h>
using namespace std;
int n;
int a[100010];
int qolle, darre;
bool ans;
int main() {
  ans = true;
  cin >> n;
  a[0] = -1;
  for (int i = 1; i <= n; i++) cin >> a[i];
  a[++n] = 1000000010;
  for (int i = 1; i < n; i++)
    if (a[i] > a[i - 1] && a[i] > a[i + 1])
      if (qolle)
        ans = false;
      else
        qolle = i;
    else if (a[i] < a[i - 1] && a[i] < a[i + 1])
      if (darre)
        ans = false;
      else
        darre = i;
  if (qolle + darre == 0)
    cout << "yes" << endl << "1 1";
  else if (ans)
    if (a[qolle] < a[darre + 1] && a[darre] > a[qolle - 1])
      cout << "yes" << endl << qolle << " " << darre;
    else
      cout << "no";
  else
    cout << "no";
}
