#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, c, c1;
  cin >> n;
  string s;
  cin >> s;
  int v = 0;
  reverse(s.begin(), s.end());
  for (int i = 1; i <= n; i++) {
    if (s[i - 1] > s[i]) {
      c = i - 1;
      c1 = i;
      v = 1;
      break;
    }
  }
  if (v == 1) {
    cout << "Yes" << endl;
    cout << c + 1 << " " << c1 + 3 << endl;
  } else
    cout << "No" << endl;
  return 0;
}
