Hold off the enemy

Given troop costs on strongholds, decide whether k troops can block every path from node n to node 1 before the invasion reaches the capital.

Medium6GraphShortest pathGreedyNo attempts yetTime limit2sMemory limit512 MB

Problem

The country of nein declared war on the country of sys. Between the two countries there are nn strongholds, and some pairs of strongholds are joined by roads. Once a stronghold falls, every stronghold joined to it by a road becomes the next target.

Each stronghold has a troop count that holds it for certain. If you station aia_i troops at stronghold ii, that stronghold survives every attack. With fewer troops it falls.

The invasion starts at stronghold nn, the capital of nein, and spreads through fallen strongholds. If it reaches stronghold 11, the capital of sys, sys loses the war. Neither capital can be garrisoned.

Yeongseon, the king of sys, has kk troops. Decide whether he can distribute them among the strongholds so that the invasion never reaches stronghold 11. The total number of troops stationed cannot exceed kk.

Input

The first line contains the number of strongholds nn, the number of roads mm, and the number of troops kk. (2n1002 \le n \le 100, 1m10001 \le m \le 1000, 1k100001 \le k \le 10000)

The second line contains a1,a2,,ana_1, a_2, \dots, a_n, where aia_i is the number of troops needed to hold stronghold ii. (1ai10001 \le a_i \le 1000) Neither capital can be garrisoned, so a1a_1 and ana_n are always 1-1.

Each of the next mm lines contains the numbers uu and vv of the two strongholds joined by a road. (1u,vn1 \le u, v \le n, uvu \ne v) Roads are bidirectional, and the same pair can appear more than once.

Output

Print YES if kk troops can be placed so that the invasion is stopped, and NO otherwise.