#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
int main() {
  int n;
  cin >> n;
  char a[N];
  cin >> a + 1;
  long long ans = 0;
  long long bb = 0;
  for (int i = 2; i <= n; ++i)
    if (a[i] != a[i - 1]) {
      if (a[i] == 'F')
        ans++;
      else
        ans--;
    }
  if (ans > 0)
    return cout << "YES", 0;
  else
    return cout << "NO", 0;
}
