#include <bits/stdtr1c++.h>

using namespace std;
#define TASK "solve"

const int N = 3e5 + 100;
const int module = 998244353;
const long long Base = 500000004;
void doc() {
}

void solve() {
    int n;
    cin >> n;
    string s;
    cin >> s;
    for (int i = 0; i < n - 1; i++) {
        if (s[i] < s[i + 1]) {
            cout << "YES" << '\n';
            cout << i + 1 << " " << i + 2;
            return;
        }
    }
    cout << "NO";
}

int main() {
    srand(time(nullptr));
    ios_base::sync_with_stdio(1); cin.tie(nullptr); cout.tie(nullptr);
    doc();
    solve();
}

