#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 2;
const int MOD = 1e9 + 7;
const int bm = 1;
int n, m, MAX;
string s;
void sinh() {
  freopen(".inp", "w", stdout);
  srand(time(0));
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> s;
  for (int i = 0; i < n; i++)
    if (s[i] < s[MAX])
      cout << "YES" << endl << MAX << " " << i, exit(0);
    else if (s[i] > s[MAX])
      MAX = i;
  cout << "NO";
}
