Score : 700 points
There are N stones arranged in a row. The i-th stone from the left is painted in the color C_i.
Snuke will perform the following operation zero or more times:
Find the number of possible final sequences of colors of the stones, modulo 10^9+7.
Input is given from Standard Input in the following format:
N C_1 : C_N
Print the number of possible final sequences of colors of the stones, modulo 10^9+7.
5 1 2 1 2 2
3
We can make three sequences of colors of stones, as follows:
6 4 2 5 4 2 4
5
7 1 3 1 2 3 3 2
5