#include <bits/stdc++.h>
using namespace std;
string str;
bool isbool = true;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, temp = 'a', idx = 0;
  cin >> n >> str;
  for (int i = 0; i < str.size(); i++) {
    if (str[i] < temp) {
      isbool = false;
    }
    temp = str[i];
    idx = i;
  }
  if (!isbool) {
    cout << "NO";
  } else {
    cout << "YES\n";
    cout << idx - 1 << " " << idx;
  }
}
