
Subin received a prescription at a hospital and purchased enough medicine for $N$ days from a pharmacy. Each day's medicine consists of one packet for the morning, one for lunch, and one for dinner. The resulting $3N$ medicine packets are connected in a row in the following order:
An ordinary person could simply eat all three meals every day and take the medicine packets by cutting them off one by one from the front. However, Subin's daily routine is not ordinary. On some days, Subin eats only dinner, while on others, Subin skips breakfast. Therefore, rather than taking the medicine in order from the front, Subin wants to take it according to the order of their meals. Of course, Subin intends to take all the medicine without leaving any packet unused.
However, Subin strongly dislikes seeing the connected medicine packets split into two separate pieces. Therefore, whenever Subin takes medicine, they cut off exactly one packet from either the front or the back of the remaining connected packets. Cutting off a packet from the middle, which would split the remaining packets into two pieces, is not allowed.
Given the order in which Subin wants to take the medicine, determine whether all the medicine can be taken in that order while following the condition above.
Input
The first line contains an integer $N$, the number of days' worth of medicine purchased. ($1 \le N \le 1\,000\,000$)
The second line contains a string $S$ of length $3N$, representing the order in which Subin wants to take the medicine. The string $S$ consists only of B, L, and D, and each of the three characters appears exactly $N$ times.
The characters B, L, and D represent morning medicine, lunch medicine, and dinner medicine, respectively.
Output
Print Yes if Subin can take all the medicine in the order given by $S$ while following the condition above. Otherwise, print No.
Examples
Input 1
1 LBD
Output 1
No
Input 2
2 BLDDBL
Output 2
Yes
Note
In the first example, the initial sequence of medicine packets is, from front to back, morning medicine, lunch medicine, and dinner medicine. The first medicine to be taken is the lunch medicine, but it is at neither the front nor the back, so it cannot be taken while satisfying the condition.
In the second example, Subin can take all the medicine in the given order by cutting off packets from the front, front, front, back, front, and front, in that order.