#include <bits/stdc++.h>
using namespace std;
map<int, int> mp;
vector<int> one, two;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    mp[x] = i;
    one.push_back(x);
    two.push_back(x);
  }
  int st, en;
  sort(one.begin(), one.end());
  st = INT_MAX;
  en = INT_MIN;
  for (int i = 0; i < n; i++) {
    int x = one[i];
    if (i != mp[x]) {
      st = min(i, st);
      en = max(i, en);
    }
  }
  if (st == INT_MAX) {
    cout << "yes" << endl;
    cout << "1 1" << endl;
    return 0;
  }
  reverse(two.begin() + st, two.begin() + en + 1);
  for (int i = 0; i < n; i++) {
    if (one[i] != two[i]) {
      cout << "no" << endl;
      return 0;
    }
  }
  cout << "yes" << endl;
  cout << st + 1 << " " << en + 1 << endl;
  return 0;
}
