#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e18;
const long long MX = 3e5 + 5;
const long double PI = 4 * atan((long double)1);
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  string s;
  cin >> n >> s;
  bool ok = 0, val;
  for (long long i = 0; i < n - 1; i++) {
    if (s[i] > s[i + 1]) {
      ok = 1;
      val = i;
      break;
    }
  }
  if (ok) {
    cout << "YES" << '\n';
    cout << val + 1 << " " << val + 2 << '\n';
  } else
    cout << "NO" << '\n';
}
