#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int N = 1e5 + 7;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  for (int i = 0; i < s.length() - 1; i++) {
    if (s[i] > s[i + 1]) {
      cout << "YES\n";
      cout << i << " " << i + 1;
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
