#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int MX = 1e8;
const long long INF = 1e18;
const int N = (int)1e5 + 5;
int a[N], b[N];
void solve() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    b[i] = a[i];
  }
  map<int, int> make_pair;
  sort(b, b + n);
  for (int i = 0; i < n; i++) {
    make_pair[b[i]] = i;
  }
  for (int i = 0; i < n; i++) {
    a[i] = make_pair[a[i]];
  }
  int L = -1;
  for (int i = 0; i < n; i++) {
    if (a[i] != i) {
      L = i;
      break;
    }
  }
  int R = -1;
  for (int i = n - 1; i >= 0; i--) {
    if (a[i] != i) {
      R = i;
      break;
    }
  }
  if (L == -1 || R == -1) {
    cout << "yes" << '\n';
    cout << 1 << " " << 1 << '\n';
  } else {
    reverse(a + L, a + R + 1);
    int ok = true;
    for (int i = 0; i < n; i++) {
      if (a[i] != i) {
        ok = false;
      }
    }
    if (ok) {
      cout << "yes" << '\n';
      cout << L + 1 << " " << R + 1 << '\n';
    } else {
      cout << "no" << '\n';
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int t = 1;
  for (int i = 1; i <= t; i++) {
    solve();
  }
  return 0;
}
