#Lutece1740. 字符串匹配

字符串匹配

Migrated from Lutece 1740 字符串匹配

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

字符集大小为mm,给定一个长为kk的字符串ss,求出所有长为11nn的串中,不包含子串ss的共有几个?

Input

输入的第一行包含三个整数m,k,n.(1m,k,n105)m,k,n.(1 \leq m,k,n \leq 10^5)

接下来一行包含kk个整数,表示串s(1sim)s( 1 \leq s_i \leq m).

Output

输出nn行表示答案,因为答案可能较大,你只需输出其在mod 109+7\text{mod } 10^9+7意义下的值

Samples

5 5 10
1 2 1 2 1
5
25
125
625
3124
15615
78051
390135
1950075
9747376

Resources

Prepared by xiper