As you may know, MemSQL has American offices in both San Francisco and Seattle. Being a manager in the company, you travel a lot between the two cities, always by plane.

You prefer flying from Seattle to San Francisco than in the other direction, because it's warmer in San Francisco. You are so busy that you don't remember the number of flights you have made in either direction. However, for each of the last n days you know whether you were in San Francisco office or in Seattle office. You always fly at nights, so you never were at both offices on the same day. Given this information, determine if you flew more times from Seattle to San Francisco during the last n days, or not.


-----Input-----

The first line of input contains single integer n (2 ≤ n ≤ 100) — the number of days.

The second line contains a string of length n consisting of only capital 'S' and 'F' letters. If the i-th letter is 'S', then you were in Seattle office on that day. Otherwise you were in San Francisco. The days are given in chronological order, i.e. today is the last day in this sequence.


-----Output-----

Print "YES" if you flew more times from Seattle to San Francisco, and "NO" otherwise.

You can print each letter in any case (upper or lower).


-----Examples-----
Input
4
FSSF

Output
NO

Input
2
SF

Output
YES

Input
10
FFFFFFFFFF

Output
NO

Input
10
SSFFSFFSFF

Output
YES



-----Note-----

In the first example you were initially at San Francisco, then flew to Seattle, were there for two days and returned to San Francisco. You made one flight in each direction, so the answer is "NO".

In the second example you just flew from Seattle to San Francisco, so the answer is "YES".

In the third example you stayed the whole period in San Francisco, so the answer is "NO".

In the fourth example if you replace 'S' with ones, and 'F' with zeros, you'll get the first few digits of π in binary representation. Not very useful information though.

Difficulty: interview

Starter code:

Solutions:
n = int(input())
s = input()
si, sf = 0, 0
for i in range(1, n):
    if s[i] == 'S' and s[i - 1] != 'S':
        si += 1
    elif s[i] == 'F' and s[i - 1] != 'F':
        sf += 1
if sf > si:
    print('YES')
else:
    print('NO')


n = int(input())
s = input()
sf = 0
fs = 0
for i in range(1, n):
    if s[i] == 'F' and s[i - 1] == 'S':
        sf += 1
    elif s[i] == 'S' and s[i - 1] == 'F':
        fs += 1
if sf > fs:
    print("YES")
else:
    print("NO")

n = int(input())
s = input()
c1, c2 = 0, 0
for i in range(1, n):
    if s[i - 1] == 'S' and s[i] == 'F':
        c1 += 1
    elif s[i - 1] == 'F' and s[i] == 'S':
        c2 += 1
if c1 > c2:
    print("YES")
else:
    print("NO")


n = int(input())

a = input()

if a.count('SF') > a.count('FS'):
    print('YES')
else:
    print('NO')


_ = input()

nights = input()
ans = 'YES' if (nights[0] == 'S' and nights[-1] == 'F') else 'NO'

print(ans)

n = int(input())
sl = input()

sf = 0
fs = 0

last = "-1"
for x in sl:
    if last == "-1" or last == x:
        last = x
        continue
    elif last == "S" and x == "F":
        sf += 1
    else:
        fs += 1
    last = x

if (sf > fs):
    print("YES")
else:
    print("NO")

n = int(input())
s = input()

k1 = 0
k2 = 0
for x in range(len(s) - 1):
    if s[x] != s[x + 1]:
        if s[x] == 'S':
            k1 += 1
        else:
            k2 += 1
if k1 > k2:
    print('YES')
else:
    print('NO')


n = int(input())
s = input().strip()
s1 = 0
s2 = 0
for i in range(1, len(s)):
    if s[i] != s[i - 1]:
        if s[i - 1] == 'S':
            s1 += 1
        else:
            s2 += 1
if s1 > s2:
    print("YES")
else:
    print("NO")

n = int(input())
s = input()
scount = 0
fcount = 0
for i in range(len(s) - 1):
    if s[i] + s[i + 1] == "SF":
        scount += 1
    elif s[i] + s[i + 1] == "FS":
        fcount += 1
if scount > fcount:
    print("YES")
else:
    print("NO")

def __starting_point():
    input()
    days = input()

    m = {}
    m["SF"] = 0
    m["FS"] = 0
    loc = days[0]
    for d in days:
        if loc != d:
            m[loc + d] += 1
            loc = d

    if m["SF"] > m["FS"]:
        print("YES")
    else:
        print("NO")

__starting_point()

n = int(input())
s = input()
a = 0
b = 0
for i in range(n - 1):
    if s[i] == 'S' and s[i + 1] == 'F':
        a += 1
    if s[i] == 'F' and s[i + 1] == 'S':
        b += 1
if a > b:
    print("YES")
else:
    print("NO")

n=int(input())
s=input()
sf,fs=[0,0]
for i in range(1,n):
    if s[i]=='F' and s[i-1]=='S':
        sf+=1
    elif s[i]=='S' and s[i-1]=='F':
        fs+=1
if sf>fs:
    print("YES")
else:
    print("NO")

n = int(input())
a = input()
s, f = 0, 0
for i in range(n-1):
    if a[i] == 'S' and a[i+1] == 'F':
        f += 1
    if a[i] == 'F' and a[i+1] == 'S':
        s += 1
print('YES' if f > s else 'NO')



n = int(input())
s = input()
a = 0
b = 0
for i in range(n - 1):
    if s[i] == 'S' and s[i + 1] ==  'F':
        a += 1
    elif s[i] == 'F' and s[i + 1] ==  'S':
        b += 1
if a > b:
    print('YES')
else:
    print('NO')

a=int(input())
d=input()
s=0
f=0
now=d[0]
for i in range(1,a):
  if d[i]=="S":
    if now!=d[i]:
      now=d[i]
      f+=1
  else:
    if now!=d[i]:
      now=d[i]
      s+=1
  now=d[i]
if s>f:
    print("YES")
else:
    print("NO")

n=int(input())
s=input()
cnt1,cnt2=0,0

for i in range(n-1):
    if s[i]=='S' and s[i+1]=='F':
        cnt1+=1
    if s[i]=='F' and s[i+1]=='S':
        cnt2+=1
if cnt1>cnt2:
    print('YES')
else:
    print('NO')

n = int(input())
s=input().strip()

c=[0,0]

for i in range(n-1):
    if s[i]!=s[i+1]:
        if s[i]=='S': 
            c[0]+=1
        else:
            c[1]+=1
print("YES" if c[0]>c[1] else "NO")


n = int(input())
a = input()

dic = {'SF': 0, 'FS': 0}

for i in range(1, n):
    if a[i - 1] == 'F' and a[i] == 'S':
        dic['FS'] += 1
    elif a[i - 1] == 'S' and a[i] == 'F':
        dic['SF'] += 1
if dic['SF'] > dic['FS']:
    print('YES')
else:
    print('NO')

n = int(input())
s = input()
sf = 0
fs = 0
last = s[0]
for i in range(n):
    if s[i] != last:
        if last == 'F':
            fs += 1
        else:
            sf += 1
        last = s[i]
if sf > fs:
    print('YES')
else:
    print('NO')

n = int(input())
s = input()
c = 0
co = 0
for i in range(1, len(s)):
    if s[i - 1] + s[i] == "SF":
        c += 1
    elif s[i - 1] + s[i] == "FS":
        co += 1
if c > co:
    print("YES")
else:
    print("NO")

n = int(input())

ss = list(input())
f = 0
s = 0
l = ss[0]
for i in range(1, len(ss)):
    c = ss[i]
    if c == l:
        continue
    if c == 'F':
        f += 1
    else:
        s += 1
    l = c

print("YES") if f > s else print("NO")


n = int(input())
s = input()

fs = 0
sf = 0 

for i in range(1,len(s)):
    if s[i] == "F" and s[i-1] == "S":
        sf += 1
    elif s[i] == "S" and s[i-1] == "F":
        fs += 1
        
if sf > fs:
    print("YES")
else:
    print("NO")

n=int(input())
s=input()
S=0
F=0
for i in range(1,n):
    if s[i]=='S':
        if s[i-1]=='F':
            S+=1
    else:
        if s[i-1]=='S':
            F+=1
if F>S:
    print('YES')
else:
    print('NO')