#H2026C. Cautious Path

Cautious Path

Problem Description

You are given a directed graph with positive edge weights containing nn vertices and mm edges. Each edge (u,v,w)(u,v,w) can only be traversed from uu to vv, and it takes exactly ww units of time; except for its two endpoints, you may not enter, leave, or change direction inside the edge.

You start from vertex ss and aim to reach vertex tt. There are kk pursuers, and the ii-th pursuer initially stands at vertex pip_i. At time 00, you and all pursuers start moving simultaneously.

Before setting off, you must determine a directed walk from ss to tt as your escape route (revisiting vertices or edges is allowed). All pursuers know the entire route and each chooses any legal action to catch you as early as possible. You and the pursuers may only move along directed edges, and may wait at vertices arbitrarily. While you are inside an edge (u,v,w)(u,v,w), you cannot stop or change direction, and you must move uniformly at speed 1/w1/w. While a pursuer is inside an edge (u,v,w)(u,v,w), the pursuer may stop, but cannot change direction; whenever the pursuer moves, the movement must be uniform at speed 1/w1/w.

If at any time there exists at least one pursuer and you:

  • are at the same vertex, or
  • are at the same position inside the same directed edge,

then you are caught; arriving at the same position at the same time also counts as being caught. Even if you reach tt at the same moment a pursuer also reaches tt, that still counts as a failure.

Determine whether you can safely reach tt. If so, find the minimum time needed to safely reach tt.

Input Format

The first line contains three integers n,m,kn,m,k, representing the number of vertices, the number of edges, and the number of pursuers.

The next mm lines each contain three integers u,v,wu,v,w, describing a directed edge from uu to vv with traversal time ww.

The next line contains two integers s,ts,t, representing your starting vertex and ending vertex.

The last line contains kk integers p1,p2,,pkp_1,p_2,\ldots,p_k, representing the initial vertices of the pursuers. When k=0k=0, this line is empty.

Output Format

If it is impossible to safely reach the destination, output:

NO

Otherwise output two lines:

YES
the minimum safe arrival time

Constraints

  • 1n,m1061\le n,m\le 10^6
  • 0kn0\le k\le n
  • 1u,v,s,t,pin1\le u,v,s,t,p_i\le n
  • 1w1091\le w\le 10^9
  • Multiple edges and self-loops are allowed.

It is guaranteed that the answer, if it exists, does not exceed 101810^{18}.

Sample

Input

6 8 1
1 2 2
2 6 10
1 3 1
3 4 1
4 6 5
5 2 1
5 3 7
5 6 8
1 6
5

Output

YES
7

Explanation

The pursuer reaches vertex 22 at time 11 at the earliest, so you cannot take 1261\to2\to6. If you choose 13461\to3\to4\to6, the arrival times at the vertices are 0,1,2,70,1,2,7, all strictly earlier than the earliest times at which the pursuer can reach those vertices, so you can safely arrive.