#include <bits/stdc++.h>
using namespace std;
int n, num;
int begin_a = 1, end_a = 1;
int nums[1000000];
bool checkReverse(int n) {
  if (n == 1) return true;
  int i;
  for (i = 1; i < n && nums[i - 1] < nums[i]; i++)
    ;
  if (i == n) return true;
  begin_a = i;
  end_a = i;
  for (int h = begin_a; h < n && nums[h] < nums[h - 1]; h++) {
    if (begin_a > 1 && nums[end_a] < nums[begin_a - 2]) return false;
    end_a++;
  }
  if (end_a == n) return true;
  if (nums[end_a] < nums[begin_a - 1]) return false;
  int f_check = end_a;
  for (int f = end_a + 1; f < n; f++) {
    if (nums[f] < nums[f - 1]) return false;
    f_check++;
  }
  return f_check + 1 == n;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> nums[i];
  }
  if (checkReverse(n)) {
    cout << "yes" << endl;
    cout << begin_a << ' ' << end_a << endl;
    return 0;
  }
  cout << "no" << endl;
  return 0;
}
