COUPLING : The act of linking together or forming couples.
Couples have to be formed from a throng(crowd). In a couple(male female only),the male partner
should be taller than the female partner.
You are given a sorted list of all people according to their heights (such that shortest in the list is the first). The elements in the list are F &/or M depicting female or male .
Now its yur duty to tell whether its possible that everyone forms a couple with the requirement stated above.
1st line: An Integer T denoting the number of test cases.
Each test Case Contains: A single line representing the list consists of only 'F '& / or 'M'.
T lines each containing 'YES' (if possible that everyone forms a couple ) or 'NO' (if not possible).
Number of Test Cases T , 1 < T <= 20
1 < Length(list) <= 10,000
Problem Setter : Vivek Bhatnagar