n = int(input())
s = str(input())

pos = 1
for i in range(n - 1, -1, -1):
    if s[i] < s[pos]:
        print("YES")
        print(pos + 1, i + 1)
        exit()
    else:
        pos += 1
print("NO")
