#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3f;
const int MOD = 1e9 + 7;
template <typename T1, typename T2>
inline bool setmin(T1 &a, const T2 &b) {
  if (b >= a) return false;
  a = b;
  return true;
}
template <typename T1, typename T2>
inline bool setmax(T1 &a, const T2 &b) {
  if (b <= a) return false;
  a = b;
  return true;
}
template <typename T1, typename T2>
inline void addmod(T1 &a, const T2 &b) {
  a = (a + b) % MOD;
}
char s[300010];
int main() {
  int n;
  cin >> n;
  scanf("%s", s);
  for (int i = 0; i < n - 1; ++i)
    if (s[i] > s[i + 1]) {
      printf("YES\n");
      printf("%d %d\n", i, i + 1);
      exit(0);
    }
  cout << "NO" << endl;
  return 0;
}
