#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ind = -1;
  string s, y;
  cin >> n >> s;
  char mn = 'z';
  for (int i = 0; i < n; i++) {
    if (s[i] <= mn) {
      ind = i;
      mn = s[i];
    }
  }
  y = s;
  sort(y.begin(), y.end());
  if (y == s) return cout << "NO" << '\n', 0;
  cout << "YES" << '\n';
  for (int i = 0; i < n; i++) {
    if (s[i] > mn) {
      cout << i + 1 << " " << ind + 1 << '\n';
      break;
    }
  }
  return 0;
}
