#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  string a = s;
  sort(a.begin(), a.end());
  for (int i = 1; i < n; i++) {
    if (s[i] < s[i - 1]) {
      cout << "YES\n" << i << " " << i + 1 << '\n';
      return 0;
    }
  }
  cout << "NO\n";
}
