#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  char c, prev;
  int delta = 0;
  cin >> c;
  prev = c;
  for (int i = 1; i < n; i++) {
    cin >> c;
    if (c == 'F' && prev == 'S')
      delta++;
    else if (c == 'S' && prev == 'F')
      delta--;
    prev = c;
  }
  cout << (delta > 0 ? "YES" : "NO");
}
