N,M,L,S,E = map(int, input().split()) edge = [[] for i in range(N)] for i in range(M): a,b,t = map(int, input().split()) a-=1;b-=1 edge[a].append((b,t)) edge[b].append((a,t)) toilet = list(map(int, input().split())) from heapq import heappush, heappop INF = 10**16 def dijkstra(N, edge, s): dist = [INF] * N que = [(0, s)] dist[s] = 0 while que: c, v = heappop(que) if dist[v] < c: continue for t, cost in edge[v]: if dist[v] + cost < dist[t]: dist[t] = dist[v] + cost heappush(que, (dist[t], t)) return dist dist1 = dijkstra(N,edge,0) dist2 = dijkstra(N,edge,N-1) #print(dist1) #print(dist2) st,en = S,S+E-1 #print(st,en) ans = 10**16 for i in toilet: i-=1 if dist1[i] < st: now = st+1 elif st <= dist1[i] <= en: now = dist1[i]+1 else: continue if dist2[i] == 10**16: continue now += dist2[i] ans = min(ans,now) print(ans if ans != 10**16 else -1)