#include <bits/stdc++.h>
using namespace std;
const int MAXN = 10010;
const int INF = 0x3f3f3f3f;
int list[MAXN];
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  string str;
  cin >> str;
  int mixn = str[0];
  for (int i = 1; i < str.length(); i++) {
    if (str[1] < mixn) {
      cout << "YES" << endl;
      cout << i + 1 << " " << i + 2;
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
