Change of Scenery
Every day you drive to work using the same roads as it is the shortest way. This is efficient, but over time you have grown increasingly bored of seeing the same buildings and junctions every day. So you decide to look for different routes. Of course you do not want to sacrifice time, so the new way should be as short as the old one. Is there another way that differs from the old one in at least one street?
Input
The first line starts with three integers and , where is the number of junctions, is the number of streets in your city and is the number of junctions you pass every day.
The next line contains integers, the (-based) indices of the junctions you pass every day. The first integer in this line will always be , the last integer will always be . There is a shortest path from to along the junctions given.
lines follow. The -th of those lines contains three integers and describes a street from junction to junction of length . Streets are always undirected.
Note that there may be multiple streets connecting the same pair of junctions. The shortest path given uses for every pair of successive junctions and a street of minimal length between and .
Output
Print one line containing "yes" if there is another way you can take without losing time and "no" otherwise.