You may perform the following operation on any number of times, possibly zero.
Choose an occurrence of AB as a contiguous substring of , and replace these two characters with a single uppercase English letter (one of A through Z) of your choice. If the replacement letter is A or B, it may be used as part of AB in a later operation.
For example, if is AAB, you may replace the last two characters AB with C, resulting in AC. If you replace them with B instead, the resulting string is AB, on which you may perform the operation again.
Find the number of distinct strings that can be obtained from by performing the operation any number of times.
Since the answer may be large, print it modulo .
输入格式
The input consists of a single test case of the following format.
N
S
The first line contains an integer (), representing the length of .
The second line contains a string of length consisting of A and B.
输出格式
Print a single integer representing the number of distinct strings that can be obtained, modulo .