The dreaded monster Godzilla has decided to visit Byteburg again. Every day the monster crawls out of the ocean, reaches one of the city's skyscrapers, and eats it together with everyone living inside. Eating one skyscraper takes Godzilla an entire day; afterwards it slips back into the sea. While moving across the city, Godzilla's tail accidentally destroys every skyscraper it passes along the way.
The citizens of Byteburg can hardly stand this. That is why, every night, one citizen flees to the countryside from each skyscraper that is still standing.
Every junction in Byteburg holds exactly one skyscraper, and the junctions are joined by two-way streets. One junction sits right next to the ocean; this is where Godzilla begins its journey each day. Godzilla always travels along streets.
Godzilla must hurry, choosing both the skyscrapers to eat and the streets to travel with great care. It cannot eat a skyscraper that has already been eaten or destroyed along the way. What is the maximum number of people Godzilla can eat before the city becomes completely deserted?
The first line contains two integers n and m (1≤n≤100000, 0≤m≤500000), the number of junctions and the number of streets. The junctions are numbered 1 through n, and junction 1 is the one next to the ocean. The second line contains n integers ki (0≤ki≤100000), where ki is the number of people living in the skyscraper at junction i. Each of the next m lines contains two integers ai and bi (1≤ai,bi≤n, ai=bi), meaning there is a street connecting junctions ai and bi. Every junction is reachable from junction 1.
Print, on a single line, the number of people Godzilla eats when it chooses which skyscrapers to eat and how to move optimally.