#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  while (cin >> n) {
    vector<int> v;
    int x;
    for (int i = 0; i < n; i++) {
      cin >> x;
      v.push_back(x);
    }
    bool in = false;
    int cnt = 0;
    bool f = true;
    bool s = false, l = false;
    int ind1 = 1, ind2 = 1;
    for (int i = 1; i < n; i++) {
      bool d = false;
      while (v[i - 1] > v[i] && i < n) {
        d = true;
        if (f) {
          ind1 = i;
          ind2 = i + 1;
          f = false;
        } else {
          ind2 = i + 1;
        }
        if (i - 1 == 0) s = true;
        if (i == n - 1) l = true;
        i++;
      }
      if (d) {
        d = false;
        cnt++;
      }
    }
    bool val = false;
    if (cnt == 0)
      val = 1;
    else if (cnt == 1) {
      if (s && l)
        val = true;
      else if (s && v[ind1 - 1] < v[ind2])
        val = true;
      else if (l && v[ind2 - 1] > v[ind1 - 2])
        val = true;
      else if (v[ind1 - 1] < v[ind2] && v[ind2 - 1] > v[ind1 - 2])
        val = true;
    }
    if (val) {
      cout << "yes" << endl;
      cout << ind1 << " " << ind2 << endl;
    } else {
      cout << "no" << endl;
    }
  }
  return 0;
}
