#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    vector<long long> v, v1;
    v.clear();
    v1.clear();
    for (int I = 0; I < n; I++) {
      long long c;
      cin >> c;
      v.push_back(c);
      v1.push_back(c);
    }
    sort(v1.begin(), v1.end());
    long long flag = 1, first = 0, last = 0;
    for (int I = 0; I < n; I++) {
      if (v[I] != v1[I]) {
        if (flag) {
          first = I;
          flag = 0;
        } else
          last = I;
      }
    }
    if (flag == 1) {
      cout << "yes" << endl << 1 << " " << 1 << endl;
    } else {
      reverse(v.begin() + first, v.begin() + last + 1);
      if (is_sorted(v.begin(), v.end()))
        cout << "yes" << endl << first + 1 << " " << last + 1 << endl;
      else
        cout << "no" << endl;
    }
  }
  return 0;
}
