There are N cities on some Japanese island and M one-directional roads connecting those cities. Each city has a museum which is open at even days and is closed at odd days. Museum of i-th city holds w_i Hokusai artworks.
Bytika arrived on the main city of the island (whis is placed at city 0) at the morning of an even day. Each day, she visits the museum in the current city (if the museum is open on that day and if she did not visit this museum before), and moves overnight to another city (possibly one she already visited) by using any one road leading from the current city. If Bytika cannot leave the current city, or if here are no chances to see new Hokusai artworks, she leaves the island by plane.
Find the maximum number of Hokusai artworks Bytika can see.
The first line of input contains two integers n and m (1≤n≤105, 0≤m≤min(n⋅(n−1),105)): the number of cities and the number of roads. The second line contains n integers w_0, w_1, …, w_n−1; i-th of those integers is the number of Hokusai artworks in the museum of i-th city (0≤w_i≤1000). Each of next m lines contains two integers s_j and t_j denoting that there is a one-directional road from city s_j to city t_j (0≤s_j,t_j≤n−1, s_j=t_j, (s_j,t_j)=(s_i,t_i) if i=j).
Print one integer: the maximum number of distinct Hokusai artworks Bytika can see while traveling on the island.