#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long int n;
  cin >> n;
  string s;
  cin >> s;
  set<char> st;
  for (long long int i = 0; i < n; i++) {
    set<char>::iterator it = st.upper_bound(s[i]);
    if (it != st.end()) {
      cout << "Yes\n";
      for (long long int j = 0; j < i; j++) {
        if (s[j] > s[i]) {
          cout << j << " " << i << endl;
          return 0;
        }
      }
    }
    st.insert(s[i]);
  }
  cout << "No" << endl;
  return 0;
}
