Website Speed Analysis#10920

Website Speed Analysis

1 second
64 megabytes
Very easy

Over the past year, the number of pages on the website of school No. 1024 has grown significantly. To optimize the site's structure, an analysis of the links between the pages is needed.

Each page has a known loading time, and information about the existing links between pages is available. If there is a link between page and page , then there is also a link from page to page . Your task is to determine the minimum time required to navigate from page to page , taking into account the loading times of page , page , and any intermediate pages.

Input

The first line contains two natural numbers: (1 \le N \le 1000), representing the number of pages on the site, and (1 \le K \le 1000000), representing the number of links.

The second line contains numbers, each representing the loading time of a respective page. The following lines each contain two numbers x_i and y_i (1 \le i \le K), indicating a link between pages x_i and y_i.

The last line contains two numbers, and (1 \le A, B \le N), which are the pages between which you need to calculate the transition time.

Output

Output the minimum transition time between pages and , or if such a transition is not possible.

Examples

Example 1

Loading
Loading