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