from heapq import heappush,heappop

def dijkstra(v):
  que=[(0,v)]
  cost=[float('INF')]*n
  cost[v]=0
  while que:
    c,v=heappop(que)
    if c>cost[v]:continue
    for nc,nv in graph[v]:
      if cost[nv]>cost[v]+nc:
        cost[nv]=cost[v]+nc
        heappush(que,(cost[nv],nv))
  return cost

n,m,l,s,e=map(int,input().split())
graph=[[] for _ in range(n)]
for _ in range(m):
  a,b,c=map(int,input().split())
  a,b=a-1,b-1
  graph[a].append((c,b))
  graph[b].append((c,a))
T=list(map(lambda x:int(x)-1,input().split()))

dist1=dijkstra(0)
distn=dijkstra(n-1)

ans=float('INF')
for t in T:
    if dist1[t]>=s+e:continue
    ans=min(ans,max(s,dist1[t])+1+distn[t])

print(ans if ans!=float('INF') else -1)