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