#include <bits/stdc++.h>
using namespace std;
const long long N = 1e6;
int d() {
  int ret;
  scanf("%d", &ret);
  return ret;
}
long long lld() {
  long long ret;
  scanf("%lld", &ret);
  return ret;
}
string multiply(string num1, string num2) {
  int n1 = num1.size();
  int n2 = num2.size();
  if (n1 == 0 || n2 == 0) return "0";
  vector<int> result(n1 + n2, 0);
  int i_n1 = 0;
  int i_n2 = 0;
  for (int i = n1 - 1; i >= 0; i--) {
    int carry = 0;
    int n1 = num1[i] - '0';
    i_n2 = 0;
    for (int j = n2 - 1; j >= 0; j--) {
      int n2 = num2[j] - '0';
      int sum = n1 * n2 + result[i_n1 + i_n2] + carry;
      carry = sum / 10;
      result[i_n1 + i_n2] = sum % 10;
      i_n2++;
    }
    if (carry > 0) result[i_n1 + i_n2] += carry;
    i_n1++;
  }
  int i = result.size() - 1;
  while (i >= 0 && result[i] == 0) i--;
  if (i == -1) return "0";
  string s = "";
  while (i >= 0) s += std::to_string(result[i--]);
  return s;
}
char arr[N];
int main() {
  int n = d();
  scanf("%s", arr);
  for (int i = 1; i < n; i++) {
    if ((int)arr[i] < (int)arr[i - 1]) {
      printf("YES\n%d %d\n", i - 1, i);
      return 0;
    }
  }
  printf("NO\n");
}
