← 返回题目列表

Codeforces · 1245/C

C. 康斯坦兹的机器

中文机器翻译题面 查看原题

康斯坦兹是村里最聪明的女孩,但她视力不好。

有一天,她发明了一台令人难以置信的机器!当你发音时,机器会将它们刻在一张纸上。例如,如果您按顺序发音“c”、“o”、“d”和“e”,那么机器就会在纸上刻下“代码”。多亏了这台机器,她终于可以不戴眼镜写信息了。

然而,她的愚蠢朋友 Akko 决定对她恶作剧。 Akko tinkered with the machine so that if you pronounce 'w', it will inscribe "uu" instead of "w", and if you pronounce 'm', it will inscribe "nn" instead of "m"!由于康斯坦丝视力不好,她无法意识到阿科做了什么。

The rest of the letters behave the same as before: if you pronounce any letter besides 'w' and 'm', the machine will just inscribe it onto a piece of paper.

第二天,我的邮箱里收到了一封信。我无法理解,所以我认为这要么只是 Akko 的一些胡言乱语,要么是 Constanze 用她的机器制作的。 But since I know what Akko did, I can just list down all possible strings that Constanze's machine would have turned into the message I got and see if anything makes sense.

但我需要知道需要多少纸张,这就是我向您寻求帮助的原因。告诉我康斯坦兹的机器会转变成我收到的消息的字符串数量。

但由于这个数字可能相当大,请告诉我除以 $$$10^9+7$$$ 后的余数。

如果 Constanze 的机器没有将任何字符串转变成我收到的消息,则打印 $$$0$$$。

输入

输入由一行组成,其中包含字符串 $$$s$$$ ($$$1 \leq |s| \leq 10^5$$$) — 收到的消息。 $$$s$$$ 仅包含小写拉丁字母。

输出

Print a single integer — the number of strings that Constanze's machine would've turned into the message $$$s$$$, modulo $$$10^9+7$$$.

示例

输入 #1

ouuokarinn

输出 #1

4

输入 #2

banana

输出 #2

1

输入 #3

nnn

输出 #3

3

输入#4

amanda

输出#4

0

注意

对于第一个示例,候选字符串如下:“ouuokarinn”、“ouuokarim”、“owokarim”和“owokarinn”。

对于第二个示例,只有一个:“香蕉”。

对于第三个示例,候选字符串如下:“nm”、“mn”和“nnn”。

对于最后一个示例,没有机器可以将其转换为“amanda”的候选字符串,因为机器不会记录“m”。