#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string a;
  cin >> a;
  bool t = false;
  bool good = false;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      int l = i;
      int r = j;
      while (l != r && l > 0 && r > 0 && l < n && r < n) {
        if (a[l] < a[r]) {
          t = true;
          break;
        }
        if (a[l] > a[r]) {
          good = true;
          break;
        }
        l++;
        r--;
      }
      if (!t && good) {
        cout << "YES" << endl << i + 1 << " " << j + 1 << endl;
        return 0;
      }
      t = false;
    }
  }
  cout << "NO" << endl;
  return 0;
}
