HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Unsorted > problem:


50968 - Number of Letters

Section problems

• 50975 - Cinema Tickets
• 50907 - Second Largest
• 50957 - Divisible by 3
• 50898 - Draw the Pattern
• 50959 - Draw the Pattern
• 50961 - Order of 3 Runner
• 50963 - Append Two Arrays
• 50893 - Print All Numbers
• 50968 - Number of Letters
• 50888 - Extracting Digits
• 50969 - Chef and Feedback
• 50962 - Find the Character
• 50974 - Area of the circle
• 50905 - Convert KPH to MPH
• 50967 - Finding Square Roots
• 50960 - Number of Heart Beats
• 50953 - ASCII Codes - Reverse

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.

Number of Letters

You are given a string. Your task is to determine whether number of occurrences of some characters in the string is equal to the sum of the numbers of occurrences of other characters in the string. 

Input

The first line of the input contains an integer T denoting the number of test cases. Each of the next T lines contains one string S consisting of lowercase Latin letters.

Output

For each test case, output a single line containing "YES" if the string satisfies the condition given above or "NO" otherwise.

Constraints

·         1 ≤ T ≤ 1000

·         1 ≤ length of S ≤ 50

Sample Input1:

Sample Input2:

4

acab

zzqzqq

abc

kklkwwww

2

ankara

saranda

Sample  Output1:

Sample  Output2:

YES

YES

NO

YES

YES

NO

 

Äëÿ îòïðàâêè ðåøåíèé íåîáõîäèìî âûïîëíèòü âõîä.

www.contester.ru