Chinese suit tiles is one of traditional Chinese Dicegame, its origins can be traced back to before the Han Dynasty, according to legend, Chinese suit tiles and Chinese chess belong to the same pulse, condensed the essence of ancient Chinese civilization, is also a quintessence of Chinese culture. China plates spread widely, basically covering most parts of China. Chinese suit tiles and Chinese mahjong card games are played similar, but more than mahjong skills and flexibility. Two to four people can play against, to hone and improve the analytical skills of thinking is very useful. Chinese suit tiles contains twenty kinds of cards , such as "一,二,三,四,五,六,七,八,九,十,壹,贰,叁,肆,伍,陆,柒,捌,玖,拾" , each kind has four cards. The rules of Chinese suit tiles is relatively simple , but more flexible. Tom has special hobby in Chinese suit tiles. As this kind game is very flexible, Tom is very difficult to see if he is the winner. As a very clever programmer, can you help him.
Each one has n (0 < n ≤ 21) cards, these cards must divide into some group, each group must have three cards, and each group must satisfy one of following rules:
1. The value of each cards is equal, for example: the value of "一" is equal to "壹".
2. The value of each cards is consecutive numbers, and each cards must be lowercase Chinese character digital or capital Chinese character digital. For example:"一二三" is satisfied the condition, but "一贰三" is not satisfied the condition.
If the number of a kind card is equal to or more than three, they must in the same group. (So "一一一一二三" or "一二三一一壹" is not satisfied the condition )
Whoes cards satisfy the rules, he is the winner.
The first line contain a number n (0 ≤ n ≤ 21),the number of cards. If input 0 is the end of the case.
The following line contain a string of letters.
"a,b,c,d,e,f,g,h,i,j,A,B,C,D,E,F,G,H,I,J" is in place of "一,二,三,四,五,六,七,八,九,十,壹,贰,叁,肆,伍,陆,柒,捌,玖,拾".
If the cards satisfy the rules, output “Yes”.
If the cards don’t satisfy the rules, output “No”.
3 acb 3 aBc 3 aaA 6 aaaAbc 0
Yes No Yes No