#include <bits/stdc++.h>
using namespace std;
bool isPrime(int n) {
  if (n <= 3) {
    return true;
  }
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
long long power(long long a, long long n) {
  long long res = 1;
  while (n) {
    if (n % 2) {
      res = (res % 1000000007 * a % 1000000007) % 1000000007;
      n--;
    }
    a = (a % 1000000007 * a % 1000000007) % 1000000007;
    n /= 2;
  }
  return res % 1000000007;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  vector<int> a(n), b(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    b[i] = a[i];
  }
  sort(b.begin(), b.end());
  int i = 0;
  int j = n - 1;
  while (i < n) {
    if (a[i] != b[i]) {
      break;
    }
    i++;
  }
  while (j >= 0) {
    if (a[j] != b[j]) {
      break;
    }
    j--;
  }
  reverse(a.begin() + i, a.begin() + j + 1);
  if (a == b) {
    cout << "yes\n";
    if (i == n && j == -1) {
      cout << 1 << " " << 1;
    } else
      cout << i + 1 << " " << j + 1;
  } else {
    cout << "no\n";
  }
  return 0;
}
