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