#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int l{0}, r{0};
  int ma{s[0]};
  for (int i = 0; i < s.size(); i++)
    if (s[i] < ma) {
      r = i + 1;
      break;
    } else if (s[i] > ma) {
      ma = s[i];
      l = i + 1;
    }
  if (l >= r || l == 0) {
    cout << "NO";
    return 0;
  }
  cout << "YES\n";
  cout << l + 1 << " " << r + 1;
  return 0;
}
