// AUTHOR - RUTVIK KOTHARI
// DAIICT , GANDHINAGAR

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
#include <ext/pb_ds/detail/standard_policies.hpp>

using namespace __gnu_pbds;
using namespace std;

#define ll long long int
#define ull unsigned long long
#define pll pair<ll,ll>
#define MS(x, y) memset(x, y, sizeof(x))
#define all(x) x.begin(),x.end()
#define ff first
#define ss second
#define INFL LLONG_MAX
#define pb push_back
#define FIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

const ll N = 1e5 + 5;
const ll M = 1e3 + 5;
const ll mod = 1e9 + 7;
const ll m1 = 1e9 + 7;
const ll m2 = 1e9 + 9;
const ll p1 = 402653189;
const ll p2 = 1610612741;
const int LN = 32;

typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;

ll powermodm(ll x,ll n,ll M){ll result=1;while(n>0){if(n % 2 ==1)result=(result * x)%M;x=(x*x)%M;n=n/2;}return result;}
ll power(ll _a,ll _b){ll _r=1;while(_b){if(_b%2==1)_r=(_r*_a);_b/=2;_a=(_a*_a);}return _r;}
ll gcd(ll a,ll b){if(a==0)return b;return gcd(b%a,a);}
ll lcm(ll a,ll b){return (max(a,b)/gcd(a,b))*min(a,b);}

ll dx[4]={-1,  1,  0,  0};
ll dy[4]={ 0,  0,  1, -1};

ll pw[LN],fact[N],invfact[N];

void pre()
{
    fact[0]=1;
    for(int i=0;i<LN;i++)pw[i]=power(2,i);
    for(int i=1;i<N;i++)fact[i]=(i*fact[i-1])%mod;
    for(int i=0;i<N;i++)invfact[i]=powermodm(fact[i],mod-2,mod);
}


int main()
{
    FIO;
    //pre();

    ll i,j;
    
    ll n;
    cin>>n;
    
    string s;
    cin>>s;
    
    string h = s;
    sort(all(h));
    
    ll idx[26]={0};
    
    if(s==h)
    {
        cout<<"NO";
        return 0;
    }
    
    for(i=0;i<n;i++)
    {
        idx[s[i]-'a'] = i+1;
    }
    cout<<"YES\n";
    
    for(i=0;i<26;i++)
    {
        if(idx[i]!=0)
        {
            for(j=i+1;j<26;j++)
            {
                if(idx[j]!=0 && idx[i]>idx[j])
                {
                    cout<<idx[j]<<" "<<idx[i];
                    return 0;
                }
            }
        }
    }
    
    return 0;
}