#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int i, n, x, m, ln = 0, in = 0, t, b, k, j, r, sn = 1, s = 0, d = 0,
                            dn = 0;
  cin >> n;
  int a[100009];
  for (i = 1; i <= n; i++) cin >> a[i];
  for (i = 1; i < n; i++) {
    if (a[i] <= a[i + 1]) s++;
  }
  for (i = 1; i < n; i++) {
    if (a[i] >= a[i + 1] && in == 0)
      d++, in = i, ln = i + 1;
    else if (a[i] >= a[i + 1] && in > 0)
      d++, ln = i + 1;
    else if (a[i] > a[i + 1] && in > 0 && ln > 0)
      break;
  }
  if (s == n - 1) {
    cout << "yes\n";
    cout << 1 << " " << 1;
  } else if (d == n - 1) {
    cout << "yes\n";
    cout << 1 << " " << n;
  } else {
    for (i = 1; i <= in - 1; i++) {
      if (i == in - 1 && a[i] > a[ln])
        break;
      else if (i == in - 1 && a[i] <= a[ln])
        d++;
      else if (a[i] > a[i + 1])
        break;
      else if (a[i] <= a[i + 1])
        d++;
    }
    for (i = ln; i <= n - 1; i++) {
      if (i == ln && a[in] > a[i + 1])
        break;
      else if (i == ln && a[in] <= a[i + 1])
        d++;
      else if (a[i] > a[i + 1])
        break;
      else if (a[i] <= a[i + 1])
        d++;
    }
    if (d == n - 1) {
      cout << "yes\n";
      cout << in << " " << ln;
    } else
      cout << "no\n";
  }
}
