#include <bits/stdc++.h>
char a[1000005];
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  int m, n;
  cin >> m;
  cin >> a;
  for (int i = 0; i < m; i++) {
    if (i == m - 1) cout << "NO" << endl;
    if (a[i] > a[i + 1]) {
      cout << "YES" << endl;
      cout << i + 1 << " " << i + 2 << endl;
      break;
    }
  }
  return 0;
}
