#pragma gcc optimze("Ofast")
#pragma loop_opt(on)
#include <bits/stdc++.h>
#define debug(x) 1&&(cout<<#x<<':'<<x<<'\n')
#define mkp make_pair
#define pb emplace_back
#define ff first
#define ss second
#define siz(v) (ll(v.size()))
#define all(v) begin(v),end(v)
#define rall(v) rbegin(v),rend(v)
#define REP(i,l,r) for(int i=(l);i<(r);i++)
#define PER(i,l,r) for(int i=(r)-1;i>=(l);i--)
#define mid (l+(r-l>>1))

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;
constexpr long double PI = acos(-1),eps = 1e-8;
constexpr ll N = 100000, INF = 1e18, MOD = 998244353, K = 400;

string s;
int id;
char m;
signed main(){
    cin >> s >> s;
    m = s[0],id = 0;
    for(int i = 1;i < siz(s);i++){
        if(s[i]>m)m = s[i],id = i;
        else return cout << "YES\n" << id+1 << ' ' << i+1,0;
    }
    cout << "NO";
}
