M(IT)+
시간 제한1초메모리 제한256 MB
문자열을 M 뒤에 IT가 한 번 이상 이어지는 조각들로 나눌 수 있는지 판정한다.
문제
Busy Beaver is bored in class one day and decides to write several strings. He calls a string repetitive if it is the character M suffixed with one or more repetitions of IT. For example, the shortest repetitive strings are MIT, MITIT, MITITIT, .
You are given a string . Determine whether it can be expressed as the concatenation of one or more repetitive strings.
입력
The first line contains a single integer () --- the number of test cases.
The first line of each test case contains a single integer () --- the length of .
The second line of each test case contains the string consisting of uppercase Latin characters.
The sum of over all test cases does not exceed .
출력
For each test case, output a single string "YES" or "NO" (without the quotes) denoting if the string is a concatenation of repetitive strings.
힌트
In the first test case, the entire string MITIT is repetitive.
In the second test case, it can be shown that the string is not a concatenation of repetitive strings.
In the third test case, the string is the following concatenation of repetitive strings: MITIT + MIT + MITITIT.