#include <bits/stdc++.h>
using namespace std;
long long n, m, x, z, cnt, ans, sum, used[10001];
vector<long long> v, v1;
string s, s1, s2;
set<long long> second;
int main() {
  cin >> n;
  cin >> s;
  for (long long i = 0; i < s.size(); i++) {
    for (long long j = i; j < s.size(); j++) {
      if (s[j] != s[j + 1]) {
        s1 += s[j];
        s2 = s1;
        reverse(s2.begin(), s2.end());
        if (s2 == s1 and s1.size() != 1) {
          cout << "YES" << endl;
          cout << i + 1 << " " << j + 1;
          return 0;
        }
      }
    }
    s1 = "";
    s2 = "";
  }
  cout << "NO";
}
