
Input=lambda:map(int,input().split())

n = int(input())
x = input()
for i in range(1,n):
    if x[i] < x[i-1]:
        print("YES")
        print(i,i+1)
        exit()
print("NO")
'''
openvpn
vpnbook
sEN6DC9
'''