#include <bits/stdc++.h>
inline void fastRead(int *a) {
  register char c = 0;
  while (c < 33) c = getchar();
  *a = 0;
  while (c > 33) {
    *a = *a * 10 + c - '0';
    c = getchar();
  }
}
inline void fastWrite(int a) {
  char snum[20];
  int i = 0;
  do {
    snum[i++] = a % 10 + 48;
    a = a / 10;
  } while (a != 0);
  i = i - 1;
  while (i >= 0) putchar(snum[i--]);
  putchar('\n');
}
const int mod = 1e9 + 7;
const int SIZE = 1e3 + 5;
int val[SIZE];
vector<int> adj[SIZE];
void print2largest(int arr[], int arr_size) {
  int i, first, second;
  if (arr_size < 2) {
    cout << "INVALID INPUT";
    return;
  }
  first = second = INT_MIN;
  for (int i = 0; i < arr_size; ++i) {
    if (arr[i] > first) {
      second = first;
      first = arr[i];
    } else if (arr[i] > second && arr[i] != first) {
      second = arr[i];
    }
  }
}
int minproduct(int arr[], int n, int k) {
  priority_queue<int, vector<int>, greater<int> > pq;
  for (int i = 0; i < n; ++i) {
    pq.push(arr[i]);
  }
  int count = 0, ans = 1;
  while (pq.empty() == false && count < k) {
    ans = ans * pq.top();
    pq.pop();
    count++;
  }
  return ans;
}
void rearrange(int arr[], int n, int x) {
  multimap<int, int> m;
  multimap<int, int>::iterator it;
  for (int i = 0; i < n; ++i) {
    m.insert(make_pair(abs(x - arr[i]), arr[i]));
  }
  int i = 0;
  for (it = m.begin(); it != m.end(); ++it) {
    arr[i++] = (*it).second;
  }
}
bool compare(int x, int y) { return abs(x) < abs(y); }
void findminsum(int arr[], int n) {
  sort(arr, arr + n, compare);
  int min = INT_MAX, x, y;
  for (int i = 1; i < n; ++i) {
    if (abs(arr[i - 1] + arr[i]) <= min) {
      min = abs(arr[i - 1] + arr[i]);
      x = i - 1;
      y = i;
    }
  }
  cout << arr[x] << " " << arr[y];
}
void showq(queue<int> gp) {
  queue<int> g = gp;
  while (!g.empty()) {
    cout << '\t' << g.front();
    g.pop();
  }
  cout << "\n";
}
using namespace std;
bool isPrime(int n) {
  if (n <= 1) {
    return false;
  }
  for (int i = 2; i < n; ++i)
    if (n % i == 0) return false;
  return true;
}
bool solve(int n) {
  set<int> s;
  while (n != 0) {
    int rem = n % 10;
    s.insert(rem);
    n /= 10;
    if (s.size() == 2) {
      return false;
    }
  }
  if (s.size() == 1) return true;
}
int power1(long long x, unsigned int n, int mod) {
  int res = 1;
  while (n) {
    if (n % 2 != 0) res = (res * x) % mod;
    n = n / 2;
    x = (x * x) % mod;
  }
  return res;
}
long long int sum(long long int n) {
  long long int sum1 = 0;
  while (n != 0) {
    sum1 += n % 10;
    n /= 10;
  }
  return sum1;
}
int main() {
  int n, f = 0;
  cin >> n;
  string s;
  cin >> s;
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      if (s[j] < s[i]) {
        cout << "YES\n";
        cout << i << " " << j;
        return 0;
      }
    }
  }
  cout << "NO";
}
