All dogs love apples. Perhaps not everyone knows this, but it is true.
Today, the red puppy was running in search of adventures. He noticed an apple tree and immediately wanted to eat some apples. The apple tree can be represented as a tree where each vertex has a certain number of apples a_v, where is the vertex number. However, there is a problem. It turns out that snakes also love apple trees and they have settled in some vertices. Since the puppy is very afraid of snakes, he does not want to be in any vertex with them. He also has a huge rope that he can use to connect any two vertices. However, not everything is so good. He noticed that the edge between vertices breaks immediately after he walks on it. More formally:
There is a tree with vertices. In each vertex of the tree, there are a_v apples, where is the vertex number. There are also vertices that cannot be visited (because there are snakes). Each edge can be traversed no more than once, but exactly one edge can be drawn between any two vertices.
Tell the puppy what is the maximum number of apples he can eat if he can start his journey from any vertex.
Note. A vertex can be visited multiple times, but the apples of that vertex are still counted only once in that case.
The first line contains two integers and (1 \le m \le n \le 2 \cdot 10^5) — the number of vertices and snakes in the tree, respectively.
The second line contains an array of length (0 \le a_i \le 10^6) — the number of apples in each vertex.
The third line contains an array of length (1 \le b_i \le n) — the indices of the vertices that have snakes.
Next, there are n - 1 lines where each line contains two integers and (1 \le u, v \le n, u \neq v) — the edges between vertices and .
You need to output a single integer — the maximum number of apples that can be eaten.
Example 1
Example 2
In the first example, we will have the following tree, where the red vertices are the vertices with snakes
Then we can draw an edge between vertex and . And we will follow the next path:
. Then the total number of apples will be .
In the second example, we will have the following tree, where the red vertices are the vertices with snakes
Then we can draw an edge between vertex and . And we will follow the next path:
. Then the total number of apples will be .
Subtask ( points): (n \le 10)
Subtask ( points): (n \le 100)
Subtask ( points): (All )
Subtask ( points): (n \le 5000)
Subtask ( points): (m = 0)
Subtask ( points): (m \le 10)
Subtask ( points): (All a_v )
Subtask ( points): (All a_v )
Subtask ( points): (All )
Subtask ( points): Without additional constraints