#D7806. Separate String

    ID: 6487 Type: Default 2000ms 536MiB

Separate String

Separate String

You are given a string tt and a set SS of NN different strings. You need to separate tt such that each part is included in SS.

For example, the following 4 separation methods satisfy the condition when t=ababt = abab and S=a,ab,bS = \\{a, ab, b\\}.

  • a,b,a,ba,b,a,b
  • a,b,aba,b,ab
  • ab,a,bab,a,b
  • ab,abab,ab

Your task is to count the number of ways to separate tt. Because the result can be large, you should output the remainder divided by 1,000,000,0071,000,000,007.

Input

The input consists of a single test case formatted as follows.

NN s1s_1 : sNs_N tt

The first line consists of an integer NN (1N100,0001 \leq N \leq 100,000) which is the number of the elements of SS. The following NN lines consist of NN distinct strings separated by line breaks. The ii-th string sis_i represents the ii-th element of SS. sis_i consists of lowercase letters and the length is between 11 and 100,000100,000, inclusive. The summation of length of sis_i (1iN1 \leq i \leq N) is at most 200,000200,000. The next line consists of a string tt which consists of lowercase letters and represents the string to be separated and the length is between 11 and 100,000100,000, inclusive.

Output

Calculate the number of ways to separate tt and print the remainder divided by 1,000,000,0071,000,000,007.

Examples

Input

3 a b ab abab

Output

4

Input

3 a b c xyz

Output

0

Input

7 abc ab bc a b c aa aaabcbccababbc

Output

160

Input

10 a aa aaa aaaa aaaaa aaaaaa aaaaaaa aaaaaaaa aaaaaaaaa aaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Output

461695029

inputFormat

outputFormat

output the remainder divided by 1,000,000,0071,000,000,007.

Input

The input consists of a single test case formatted as follows.

NN s1s_1 : sNs_N tt

The first line consists of an integer NN (1N100,0001 \leq N \leq 100,000) which is the number of the elements of SS. The following NN lines consist of NN distinct strings separated by line breaks. The ii-th string sis_i represents the ii-th element of SS. sis_i consists of lowercase letters and the length is between 11 and 100,000100,000, inclusive. The summation of length of sis_i (1iN1 \leq i \leq N) is at most 200,000200,000. The next line consists of a string tt which consists of lowercase letters and represents the string to be separated and the length is between 11 and 100,000100,000, inclusive.

Output

Calculate the number of ways to separate tt and print the remainder divided by 1,000,000,0071,000,000,007.

Examples

Input

3 a b ab abab

Output

4

Input

3 a b c xyz

Output

0

Input

7 abc ab bc a b c aa aaabcbccababbc

Output

160

Input

10 a aa aaa aaaa aaaaa aaaaaa aaaaaaa aaaaaaaa aaaaaaaaa aaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Output

461695029

样例

3
a
b
ab
abab
4