A tight-knit group of friends once took a trip together to the picturesque country of Molvania. During their stay a series of unfortunate events took place, and the trip ended on its final evening with everyone exchanging heartfelt cries of "I never want to see you again!"
Back home, the now-former friends realize that they never split the costs of the trip evenly. Some of them may be out several thousand crowns. Settling up turns out to be trickier than it should be: many in the group refuse to speak to one another, and are even less willing to hand each other money.
You decide to help. You ask each person how much money they owe (or are owed) and with whom they are still friends. Using only this information, you want to determine whether everyone can settle their debts exactly, moving money only between people who are still friends (money may still be passed along a chain of friends).
The first line contains two integers $n$ ($2 \le n \le 10000$) and $m$ ($0 \le m \le 50000$): the number of friends and the number of remaining friendships.
Each of the next $n$ lines contains an integer $o$ ($-10000 \le o \le 10000$); the $i$-th of these lines gives how much person $i$ owes (or is owed, if $o < 0$). The sum of all these values is $0$.
Each of the next $m$ lines contains two integers $x$ and $y$ ($0 \le x < y \le n-1$), indicating that persons $x$ and $y$ are still friends.
Print a single line containing "POSSIBLE" if everyone can settle their debts, or "IMPOSSIBLE" otherwise.