#include <bits/stdc++.h>
using namespace std;
int main() {
  {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
  };
  int n;
  cin >> n;
  string s;
  cin >> s;
  string t = s;
  sort(t.begin(), t.end());
  if (s == t)
    cout << "NO" << endl;
  else {
    cout << "YES" << endl;
    int l[26] = {0};
    int max1 = s[0] - 'a', max2 = 0;
    for (int i = 1; i < n; i++) {
      if (s[i] - 'a' > max1) {
        max1 = s[i] - 'a';
        max2 = i;
      } else {
        cout << max2 + 1 << " " << i + 1 << endl;
        return 0;
      }
    }
  }
  return 0;
}
