#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int n, i;
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  cin >> s;
  for (i = 1; i < n; i++) {
    if (s[i] < s[i - 1]) {
      cout << "YES\n" << i - 1 << " " << i << "\n";
      return 0;
    }
  }
  cout << "NO\n";
  return 0;
}
