Codeforces Round #523 (Div. 2) C. Multiplicity
You are given an integer array a1,a2,…,ana1,a2,…,an .
The array bb is called to be a subsequence of aa if it is possible to remove some elements from aa to get bb .
Array b1,b2,…,bkb1,b2,…,bk is called to be good if it is not empty and for every
Find the number of good subsequences in aa modulo 109+7109+7 .
Two subsequences are considered different if index sets of numbers included in them are different. That is, the values of the elements do not matter in the comparison of subsequences. In particular, the array