String game
Practice
0 (0 votes)
Medium
Easy
Problem
28% Success 139 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code

Substring of a string is defined as a contiguous sequence of characters. And count of substring is the factorial of number of repetitions of that substring in the set containing all the substrings of a given string. Yash's teacher gives him a string  and asks him to find the sum of count of all the unique substrings of a string. Since Yash is a noob, he wants your help to solve the above task.

UPDATE: As the number can be very large print the output modulo 1e9+7.


INPUT 

The only line of input contains a string of lowercase English alphabets .


OUTPUT

Print the required answer . 


CONSTRAINTS

\(1 \leq length of String \leq 4*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:20
7 votes
Tags:
Hash functionEasyStringHashing algorithm
Points:20
10 votes
Tags:
StringImplementationRecruitBasic ProgrammingAlgorithmsEasyString AlgorithmsApprovedHashing algorithmHashing algorithm
Points:20
13 votes
Tags:
String AlgorithmsAlgorithmsHashing Algorithm
Editorial

No editorial available for this problem.