#include <bits/stdc++.h>
const int Max = 100001;
using namespace std;
typedef struct Node {
  long long x;
  long long num;
} node;
node s[Max], k[Max], t[Max];
bool cmp(node a, node b) { return a.x < b.x; }
int main() {
  long long n, m, i, j, p, sum, st, ed, d1, d2, d3;
  while (cin >> n) {
    for (i = 1; i <= n; i++) {
      cin >> s[i].x;
      s[i].num = i;
    }
    p = 0;
    for (i = 2; i < n; i++) {
      d1 = s[i - 1].x;
      d2 = s[i].x;
      d3 = s[i + 1].x;
      if ((d2 > d1 && d2 > d3) || (d2 < d1 && d2 < d3)) p += 1;
    }
    if (p > 2) {
      cout << "no" << endl;
    } else if (p >= 1) {
      if (p == 2) {
        long long u, v;
        for (i = 2; i < n; i++) {
          d1 = s[i - 1].x;
          d2 = s[i].x;
          d3 = s[i + 1].x;
          if ((d2 > d1 && d2 > d3)) {
            u = i;
          }
          if ((d2 < d1 && d2 < d3)) {
            v = i;
          }
        }
        if (u < v) {
          if (s[u - 1].x > s[u + 1].x) {
            cout << "no" << endl;
            continue;
          }
        } else if (u > v) {
          long long vm, um;
          vm = 1;
          um = 1;
          for (i = 2; i <= v; i++) {
            if (s[i].x < s[i - 1].x) vm += 1;
          }
          for (i = u; i < n; i++) {
            if (s[i].x > s[i + 1].x) um += 1;
          }
          if (vm == v && (um == (n - v))) {
            cout << "no" << endl;
            continue;
          }
        }
      }
      sort(s + 1, s + (n + 1), cmp);
      sum = 0;
      for (i = 1; i <= n; i++) {
        k[i].x = s[i].num;
        k[i].num = i;
        t[i].x = k[i].x;
        t[i].num = i;
      }
      sort(k + 1, k + (n + 1), cmp);
      for (i = 1; i <= n; i++) {
        if (t[i].x == k[i].num) sum += 1;
      }
      if (sum != n) {
        cout << "no" << endl;
      } else {
        for (i = 1; i <= n; i++) {
          if (t[i].num != k[i].num) {
            st = i;
            break;
          }
        }
        for (j = n; j >= 1; j--) {
          if (t[j].num != k[j].num) {
            ed = j;
            break;
          }
        }
        cout << "yes" << endl;
        cout << st << " " << ed << endl;
      }
    } else if (p == 0) {
      if (n == 1) {
        cout << "yes" << endl;
        cout << 1 << " " << 1 << endl;
      } else {
        if (s[1].x > s[n].x) {
          cout << "yes" << endl;
          cout << 1 << " " << n << endl;
        } else {
          cout << "yes" << endl;
          cout << 1 << " " << 1 << endl;
        }
      }
    }
  }
  return 0;
}
