#include <bits/stdc++.h>
using namespace std;
void debug(vector<long int> v) {
  for (long int i = 0; i < v.size(); ++i) {
    cerr << v[i] << " ";
  }
  cerr << "\n";
}
void print(vector<long int> v) {
  for (long int i = 0; i < v.size(); ++i) {
    cout << v[i] << " ";
  }
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long int n;
  cin >> n;
  vector<long int> a, b;
  for (long int i = 0; i < n; ++i) {
    long int x;
    cin >> x;
    a.emplace_back(x);
    b.emplace_back(x);
  }
  sort(b.begin(), b.end());
  unordered_map<long int, long int> m;
  for (long int i = 0; i < n; ++i) {
    m[b[i]] = i;
  }
  long int s_index = -1;
  for (long int i = 0; i < n; ++i) {
    if (m[a[i]] != i) {
      s_index = i;
      break;
    }
  }
  long int e_index = -1;
  for (long int i = n - 1; i >= 0; --i) {
    if (m[a[i]] != i) {
      e_index = i;
      break;
    }
  }
  if (s_index == -1 || e_index == -1) {
    cout << "yes"
         << "\n";
    cout << 1 << " " << 1 << "\n";
  } else {
    reverse(a.begin() + s_index, a.begin() + e_index + 1);
    bool flag = true;
    for (long int i = 0; i < n; ++i) {
      if (m[a[i]] != i) {
        flag = false;
        break;
      }
    }
    if (flag) {
      cout << "yes"
           << "\n";
      cout << s_index + 1 << " " << e_index + 1 << "\n";
    } else {
      cout << "no"
           << "\n";
    }
  }
}
