P26865 [AtCoder] Nobitasu
NOI
题目描述

Problem Description

Score: $ 500 $ points

In the math class of the 71st grade at Tsukuba High School, an operation called "Nobitasu" appeared. Nobitasu of $ x $ and $ y $ represents the operation of concatenating $ x $ and $ y $ as strings.

For example, Nobitasu of $ 10 $ and $ 20 = 1020 $. For a given positive integer $ x $, consider performing one of the following operations for each $i=1, 2, \ldots, Q$:

  1. Replace $ x $ with $ x + A_i $
  2. Replace $ x $ with Nobitasu of $ x $ and $ A_i $

There are $ 2^Q $ ways to perform the operations. For all of these ways, find the final $ x $ and compute the sum of all final $ x $ modulo $ 10^9 + 7 $.

Input Format

The input is given from the standard input in the following format:

\(Q\) \(x\)
\(A_1\)
\(A_2\)
\(⋮\)
\(A_Q\)

Output Format

Output the sum of all final $ x $ modulo $ 10^9 + 7 $. Do not forget to add a newline at the end of the output.

Sample Input and Output

Sample Input #1

1 3
10

Sample Output #1

323

Sample Input #2

4 10
12
21
30
9

Sample Output #2

116122282

Sample Input #3

10 102
2109
10329
710923
49832
5437
57432389
78322
572973938
923483
998244353

Sample Output #3

986794595

Notes/Hints

None

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
1 3 10
样例输出
323