#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, y, j, i;
  cin >> n;
  char s[n + 1];
  cin >> s;
  j = 0;
  i = n - 1;
  while (j < i) {
    x = s[i];
    y = s[j];
    if (x < y) {
      cout << "YES" << endl;
      cout << j + 1 << " " << i + 1;
      return 0;
    }
    x = s[j + 1];
    if (x > y) {
      j++;
      continue;
    }
    y = s[i - 1];
    if (x > y) {
      i--;
      continue;
    }
    j++;
  }
  cout << "NO";
  return 0;
}
