#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (a < b)
    return gcd(b, a);
  else if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
long long int isPrime(long long int n) {
  long long int p = (long long int)sqrt(n);
  for (long long int i = (2); i <= (p); i += (1))
    if (n % i == 0) return 0;
  return 1;
}
long long int pow(long long int b, long long int e) {
  if (e == 0)
    return 1;
  else if (e % 2 == 0) {
    long long int a = pow(b, e / 2);
    return a * a;
  } else {
    long long int a = pow(b, e / 2);
    return b * a * a;
  }
}
long long int powm(long long int x, long long int y,
                   long long int m = 1000000007) {
  x = x % m;
  long long int res = 1;
  while (y) {
    if (y & 1) res = res * x;
    res %= m;
    y = y >> 1;
    x = x * x;
    x %= m;
  }
  return res;
}
long long int lcm(long long int a, long long int b) {
  return (a * b) / gcd(a, b);
}
long long int modInverse(long long int a, long long int m) {
  return powm(a, m - 2, m);
}
bool issq(long long int n) {
  long long int p = sqrt(n);
  return p * p == n;
}
vector<long long int> primes;
void seive1(long long int n) {
  primes.resize(n + 1);
  for (long long int i = (2); i <= (n); i += (1))
    if (primes[i] == 0) {
      primes[i] = i;
      for (long long int j = (i * i); j <= (n); j += (i))
        if (primes[j] == 0) primes[j] = i;
    }
}
bool prime[1000000];
void seive() {
  long long int n = 1000000 - 2;
  memset(prime, true, sizeof(prime));
  prime[0] = 0, prime[1] = 0;
  for (long long int i = 2; i <= n; i++)
    if (prime[i])
      for (long long int j = 2 * i; j <= n; j += i) prime[j] = false;
}
long long int extended_GCD(long long int a, long long int b, long long int &x,
                           long long int &y) {
  if (a == 0) {
    x = 0;
    y = 1;
    return b;
  }
  long long int x1, y1;
  long long int gcd = extended_GCD(b % a, a, x1, y1);
  x = y1 - (b / a) * x1;
  y = x1;
  return gcd;
}
long long int mulInv(long long int a, long long int mod = 1000000007) {
  long long int x, y;
  extended_GCD(a, mod, x, y);
  if (x < 0) x += mod;
  return x;
}
long long int find(long long int num[], long long int rem[], long long int k,
                   long long int prod) {
  long long int result = 0;
  for (long long int i = 0; i < k; i++) {
    long long int pp = prod / num[i];
    result += rem[i] * mulInv(pp, num[i]) * pp;
  }
  return result % prod;
}
class DSU {
 public:
  vector<long long int> a, rank;

 public:
  long long int c;
  map<string, long long int> m;

 public:
  DSU(long long int n) {
    c = 1;
    a.resize(n + 1);
    rank.resize(n + 1);
    for (long long int i = 1; i <= n; i++) a[i] = i;
  }

 public:
  long long int root(long long int x) {
    long long int u = x;
    while (a[x] != x) {
      a[x] = a[a[x]];
      x = a[x];
    }
    a[u] = x;
    return x;
  }

 public:
  void unite(long long int x, long long int y) {
    x = root(x);
    y = root(y);
    if (x != y) {
      if (rank[x] < rank[y])
        a[y] = x;
      else
        a[x] = y;
    }
  }
};
bool cmp(pair<long long int, long long int> &p1,
         pair<long long int, long long int> &p2) {
  if (p1.first == p2.first) {
    return p1.second > p2.second;
  }
  return p1.first < p2.first;
}
bool isPalindrome(string s) {
  long long int i, j;
  for (i = 0, j = s.length() - 1; i <= j; i++, j--) {
    if (s[i] != s[j]) {
      return 0;
    }
  }
  return 1;
}
long long int dp[100005][2];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int n, m, q, i, j, k, a, b, c, d, x,
      y = 0, z, count = 0, count1 = 0, sum2 = 0, sum = 0, sum1 = 0, p, flag = 0,
      diff, flag1 = 0, flag2 = 0, flag3 = 0, flag4 = 0, ans = 0, max2 = INT_MIN;
  string s, s1;
  cin >> n;
  long long int ar[n], br[n];
  long long int index;
  unordered_map<long long int, long long int> m1;
  for (long long int i = (0); i <= (n - 1); i += (1)) {
    cin >> ar[i];
    m1[ar[i]] = i;
  }
  sort(ar, ar + n);
  for (i = 0; i < n; i++) {
    if (m1[ar[i]] - i != 0) {
      sum++;
    }
  }
  for (i = 0; i < n; i++) {
    if (m1[ar[i]] - i == 0) {
      continue;
    } else {
      c = i + 1;
      a = m1[ar[i]] - i;
      i++;
      count++;
      while (i < n && (m1[ar[i]] - i < a) && m1[ar[i]] - i != 0) {
        flag = 1;
        a = m1[ar[i]] - i;
        i++;
        count++;
      }
      index = i;
    }
    break;
  }
  if (sum == 0) {
    cout << "yes\n";
    cout << "1 1";
    return 0;
  } else {
    if (count < sum) {
      i = index + 1;
      a = 0;
      while (i < n && (m1[ar[i]] - i < a) && m1[ar[i]] - i != 0) {
        flag = 1;
        a = m1[ar[i]] - i;
        i++;
        count++;
      }
      index = i;
    }
    if (count == sum) {
      cout << "yes\n";
      cout << c << " " << index;
      return 0;
    } else {
      cout << "no";
    }
  }
}
