Bear and Crying
Practice
3.9 (62 votes)
Mathematics
Open
Approved
Easy Medium
Mathamatics
Problem
87% Success 3657 Attempts 30 Points 1s Time Limit 256MB Memory 1024 KB Max Code

View Russian Translation

Limak is a polar bear who often chats online with his friends. Nowadays, bears often use emoticons to express their feelings. While most emoticons are short and boring, there is one exception.

Crying emoticon is made of any positive number of underscores between two semicolons. So the shortest example is ;_; but it can also be e.g. ;__; or ;_____________;.

Limak sent you a message of length N consisting of underscores and semicolons. Polar bears are easily distracted so Limak could have typed some characters by mistake. You wonder how many ways there are to ignore some (maybe none) characters and obtain a crying emoticon. This number could be big so find it modulo 10^9+7.

Input format:

The only line contains one string consisting of N characters, denoting a message from Limak. Each character of string is either ; (semicolon) or _ (underscore).

Output format:

In the single line print the answer modulo 10^9+7.

Constraints:

1 <= N <= 10^5

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:30
3 votes
Tags:
Ad-HocEasy-MediumMath
Points:30
7 votes
Tags:
Basic MathEasy-MediumMathematicsMathematics
Points:30
5 votes
Tags:
MathematicsBasic MathMath