#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
const double PI = 3.1415926535897932384626433832795;
const int maxn = 1000007;
const long double eps = 1e-8;
int main() {
  int n;
  string a;
  cin >> n >> a;
  int res1 = 0, res2 = 0;
  for (int(i) = (1); (i) < (n); ++i) {
    if (a[i - 1] != a[i]) {
      if (a[i] == 'S') {
        res2++;
      } else {
        res1++;
      }
    }
  }
  if (res1 > res2) {
    cout << "YES";
    return 0;
  }
  cout << "NO";
  return 0;
}
