#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  int sf = 0, fs = 0;
  char lp = s[0];
  for (int i = 1; i < n; i++) {
    if (s[i] == 'S' && lp == 'F') {
      fs++;
    } else if (s[i] == 'F' && lp == 'S') {
      sf++;
    }
    lp = s[i];
  }
  (sf > fs) ? cout << "YES\n" : cout << "NO\n";
  return 0;
}
