#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  string a = s;
  sort(a.begin(), a.end());
  if (a != s) {
    cout << "YES\n1 " << s.size() << '\n';
  } else {
    cout << "NO\n";
  }
}
