#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  int inp[n + 1];
  for (int i = 1; i <= n; ++i) {
    cin >> inp[i];
  }
  int l = -1;
  for (int i = 1; i <= n - 1; ++i) {
    if (inp[i + 1] - inp[i] < 0) {
      l = i;
      break;
    }
  }
  if (l == -1) {
    cout << "yes\n";
    cout << "1 1";
    return 0;
  }
  int r = -1;
  for (int i = n; i >= 2; --i) {
    if (inp[i - 1] - inp[i] > 0) {
      r = i;
      break;
    }
  }
  reverse(inp + l, inp + r + 1);
  for (int i = 1; i <= n - 1; ++i) {
    if (inp[i] > inp[i + 1]) {
      cout << "no";
      return 0;
    }
  }
  cout << "yes\n";
  cout << l << " " << r;
}
