#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  int a[n];
  for (register int i = 0; i < (n); i++) cin >> a[i];
  int f = -1, s = -1, t = -1;
  for (register int i = 0; i < (n - 1); i++)
    if (a[i] > a[i + 1]) {
      f = i;
      break;
    }
  if (f != -1)
    for (register int i = f; i < (n - 1); i++)
      if (a[i] < a[i + 1]) {
        s = i;
        break;
      }
  if (s != -1)
    for (register int i = s; i < (n - 1); i++)
      if (a[i] > a[i + 1]) {
        t = i;
        break;
      }
  if (t != -1)
    cout << "no";
  else {
    if (f == -1)
      cout << "yes\n1 1";
    else {
      if (s == -1)
        s = n;
      else
        s++;
      reverse(a + f, a + s);
      int c = 0;
      for (register int i = 0; i < (n - 1); i++) c += a[i + 1] < a[i];
      if (c)
        cout << "no";
      else
        cout << "yes\n" << f + 1 << ' ' << s << endl;
    }
  }
  return 0;
}
