#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
inline int read() {
  int x = 0;
  char c = getchar();
  bool flag = 0;
  while (c < '0' || c > '9') {
    if (c == '-') flag = 1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 3) + (x << 1) + c - '0';
    c = getchar();
  }
  if (flag) x = -x;
  return x;
}
void chkmax(int &a, int b) {
  a = max(a, b);
  return;
}
void chkmin(int &a, int b) {
  a = min(a, b);
  return;
}
long long ppow(long long x, long long s) {
  if (!s) return 1;
  if (!(s - 1)) return x % mod;
  if (s % 2) return (x * ppow(x, s - 1)) % mod;
  long long b = ppow(x, s / 2);
  return (b * b) % mod;
}
int main() {
  int n;
  char s[200010 << 1];
  cin >> n;
  cin >> s;
  for (int i = 0; i < n; ++i)
    if (s[i + 1] < s[i]) {
      printf("YES\n");
      printf("%d %d\n", i + 1, i + 2);
      return 0;
    } else
      printf("NO\n");
  return 0;
}
