#include <bits/stdc++.h>
using namespace std;
const long long N = 1e6 + 7;
const long long INF = 1e9;
const long long mod = 1e9 + 7;
int n;
int T;
int x;
char a;
string s;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> s;
  x = n;
  for (int i = 0; i < n; i++) {
    if (s[i] != 'a') {
      x = i;
      break;
    }
  }
  for (int i = x; i < n; i++) {
    if (s[i] < s[x]) {
      a = s[i];
      T = 1;
      break;
    }
  }
  if (!T) {
    cout << "NO";
    return 0;
  }
  cout << "YES" << endl;
  cout << x + 1 << " " << s.find(a, x) + 1;
}
