n = int(input())
s = input()
s1 = ''.join(sorted(s))
if(s==s1):
    print("NO")
else:
    print("YES")
    for i in range(len(s)):
        if(s[i]!=s1[i]):
            print(i+1, i+2)
            break
        
    
