Kefa decided to celebrate his first big salary by going to the restaurant.
He lives by an unusual park. The park is a rooted tree consisting of vertices with the root at vertex . Vertex also contains Kefa's house. Unfortunately for our hero, the park also contains cats. Kefa has already found out what are the vertices with cats in them.
The leaf vertices of the park contain restaurants. Kefa wants to choose a restaurant where he will go, but unfortunately he is very afraid of cats, so there is no way he will go to the restaurant if the path from the restaurant to his house contains more than consecutive vertices with cats.
Your task is to help Kefa count the number of restaurants where he can go.
The first line contains two integers and — the number of vertices of the tree and the maximum number of consecutive vertices with cats that is still ok for Kefa.
The second line contains integers , where each either equals to (then vertex has no cat), or equals to (then vertex has a cat).
Next lines contains the edges of the tree in the format , where and are the vertices of the tree, connected by an edge.
It is guaranteed that the given set of edges specifies a tree.
Print the number of distinct leaves of a tree the path to which from Kefa's home contains at most consecutive vertices with cats.