#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long cnt = 1;
  for (long long i = 1; i < n; i++) {
    if (s[i] - '0' >= s[i - 1] - '0') cnt++;
  }
  if (cnt == n) {
    cout << "NO" << '\n';
    return;
  } else {
    cout << "YES" << '\n';
  }
  long long q = 0;
  while (s[q] == s[0]) q++;
  cout << q + 1 << " ";
  long long p = q + 1;
  while (s[p] == s[q] && s[p] < s[q]) p++;
  cout << p + 1;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
