#include <bits/stdc++.h>
using namespace std;
long long n, i, j, k, l, m, arr[200010], u, v, x, r, a, b, c, d,
    od = 0, ev = 0, arr1[200010], p, hi, lo, mid, s, y, t, res = 0;
map<long long, long long> mp, mp1;
vector<long long> vc, vc1;
long long vis[100010] = {0};
string st, st1;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  vector<long long> vc2;
  for (i = 0; i < n; i++) {
    cin >> a;
    vc.push_back(a);
  }
  vc1 = vc;
  sort(vc1.begin(), vc1.end());
  if (vc == vc1) {
    cout << "yes" << endl << 1 << ' ' << 1;
    return 0;
  }
  for (i = 0; i < n and vc[i] == vc1[i]; i++)
    ;
  for (j = n - 1; j >= 0 and vc[j] == vc1[j]; j--)
    ;
  k = i + 1, l = j + 1;
  while (i < j) {
    swap(vc[i], vc[j]);
    i++;
    j--;
  }
  if (vc == vc1)
    cout << "yes" << endl << k << ' ' << l;
  else
    cout << "no";
}
