#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, o(0), i, j;
  string x;
  cin >> a >> x;
  string b;
  for (i = 0; i < a; ++i) {
    for (j = i; j < a; ++j) {
      b = x;
      reverse(b.begin() + i, b.begin() + j);
      if (b < x) {
        o = 1;
        break;
      }
    }
    if (o == 1) break;
  }
  if (o == 1)
    cout << "YES" << endl << i + 1 << " " << j + i + 1;
  else
    cout << "NO";
}
