#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6;
const int INF = 1e9;
const long long linf = 0x3f3f3f3f3f3f3f3f;
const double PI = acos(-1.0);
long long mod = 1e9 + 7;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int f = 0;
  for (int i = 1; i < n; i++) {
    if (s[i] < s[i - 1]) {
      cout << "YES" << endl;
      cout << i + 1 << ' ' << i + 2 << endl;
      exit(0);
    }
  }
  cout << "NO" << endl;
}
