n = int(input())
inp = input()
s = ''.join(sorted(inp))

if(s==inp):
    print("NO")
else:
    print("YES")
    for i in range(len(inp)):
        
        if(inp[i]!=s[i]):
            print(i, i+1)
            break
        
    
