#include <bits/stdc++.h>
using namespace std;
vector<long long> v;
map<long long, long long> mp;
set<long long> s;
long long mn = INT_MAX, mx = INT_MIN;
long long i, j, tmp, sum, cn, ans, res;
long long a[100005], b[100005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  long long n, l = 0, r = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    b[i] = a[i];
  }
  sort(b, b + n);
  for (i = 0; i < n; i++) {
    if (a[i] != b[i]) {
      l = i;
      break;
    }
  }
  for (i = n - 1; i >= 0; i--) {
    if (a[i] != b[i]) {
      r = i;
      break;
    }
  }
  reverse(a + l, a + r + 1);
  for (i = 0; i < n; i++) {
    if (a[i] != b[i]) {
      cout << "no";
      return 0;
    }
  }
  cout << "yes" << endl << l + 1 << " " << r + 1;
  return 0;
}
