#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n, l, r, flag = 0;
  char p[300005];
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    if (p[i + 1] < p[i]) {
      l = i + 1;
      r = i + 2;
      flag = 1;
      break;
    }
  }
  if (flag)
    cout << "YES\n" << l << " " << r << endl;
  else
    cout << "NO" << endl;
}
