n = int(input())
s = str(input())
X = [[] for i in range(26)]
for i, c in enumerate(s):
    j = ord(c)-ord('a')
    if j != 25:
        for k in range(j+1, 26):
            if len(X[k]) == 0:
                continue
            else:
                print('YES')
                print(X[k][0]+1, i+1)
                exit()
    X[j].append(i)
print('NO')
