#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
int main(int argc, char const *argv[]) {
  cin.sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  string s;
  cin >> s;
  for (int i = 0; i < t - 1; i++) {
    if (s[i] < s[i + 1]) {
      cout << "YES" << endl;
      cout << i + 1 << " " << i + 2;
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
