import heapq N,M,s,t = map(int,input().split()) P = [0]+list(map(int,input().split())) G = {i:[] for i in range(1,N+1)} for _ in range(M): a,b = map(int,input().split()) G[a].append(b) G[b].append(a) que = [] X = P[s] Y = 0 for x in G[s]: heapq.heappush(que,(-P[x],x)) visited = [False]*(N+1) visited[s] = True while que: p,x = heapq.heappop(que) p = -p if p