题目要求

For each test case, print in one line the number of PAT’s contained in the string. Since the result may be a huge number, you only have to output the result moded by 1000000007.


这句话很重要!
如果能够偶理解,当字符串很长时,那么很可能其中一个A的PTA就会超过1000000007,所以题目的意思是:每一个A得到的结果都要先取模,而不是最后再取
如果最后才取,那么最后两个检测点会报错。