#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int good = 0, bad = 0;
  for (int i = 0; i < n - 1; i++) {
    if (s[i] != s[i + 1]) {
      if (s[i] == 'S')
        good++;
      else
        bad++;
    }
  }
  (good > bad) ? puts("YES") : puts("NO");
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
