# This file created by Kmoussai
import sys
if len(sys.argv) > 1:
    if sys.argv[1] == "LOCAL":
        sys.stdin = open("input.in", 'r')


n = int(input())
s = input()
i = n
j = 1

while i >= 1 and i > j:
    if s[i - 1] == s[j - 1]:
        j += 1
        break
    i -= 1
if i != 0 and j != i:
    print("YES")
    print(j, i)
else:
    print("NO")
