LearnPy Hub
← Arena
AdvancedRating 1700

Different Subsequences

Count the different non-empty subsequences of s (as strings), modulo 1 000 000 007.

Input

One string (length ≤ 3000).

Output

One integer.

Sample 1

Input
abc
Output
7

Sample 2

Input
aba
Output
6
solution.py
Output appears here
Different Subsequences · Python Arena problem · LearnPy Hub