You are given a forest with N vertices and M edges. The vertices are numbered 0 through N-1. The edges are given in the format (x_i,y_i), which means that Vertex x_i and y_i are connected by an edge.

Each vertex i has a value a_i. You want to add edges in the given forest so that the forest becomes connected. To add an edge, you choose two different vertices i and j, then span an edge between i and j. This operation costs a_i + a_j dollars, and afterward neither Vertex i nor j can be selected again.

Find the minimum total cost required to make the forest connected, or print `Impossible` if it is impossible.

Constraints

* 1 ≤ N ≤ 100,000
* 0 ≤ M ≤ N-1
* 1 ≤ a_i ≤ 10^9
* 0 ≤ x_i,y_i ≤ N-1
* The given graph is a forest.
* All input values are integers.

Input

Input is given from Standard Input in the following format:


N M
a_0 a_1 .. a_{N-1}
x_1 y_1
x_2 y_2
:
x_M y_M


Output

Print the minimum total cost required to make the forest connected, or print `Impossible` if it is impossible.

Examples

Input

7 5
1 2 3 4 5 6 7
3 0
4 0
1 2
1 3
5 6


Output

7


Input

5 0
3 1 4 1 5


Output

Impossible


Input

1 0
5


Output

0


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
import java.util.function.BiFunction;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

public class Main {
    public static void main(final String[] args) {
        final FastScanner scanner = new FastScanner(System.in);
        final int n = scanner.nextInt();
        final int m = scanner.nextInt();

        final BiFunction<Integer, Integer, Boolean> isTree = (nodes, edges) -> edges == nodes - 1;
        if (isTree.apply(n, m)) {
            System.out.println(0);
            return;
        }

        final BiFunction<Integer, Integer, Boolean> isImpossible = (nodes, edges) -> nodes < 2 * (nodes - edges - 1);
        if (isImpossible.apply(n, m)) {
            System.out.println("Impossible");
            return;
        }

        final List<Long> costs = IntStream.range(0, n)
            .mapToObj(i -> scanner.nextLong())
            .collect(Collectors.toList());

        final List<Edge> edges = IntStream.range(0, m)
            .mapToObj(i -> new Edge(scanner.nextInt(), scanner.nextInt()))
            .collect(Collectors.toList());

        final List<List<Integer>> forest = makeForest(edges, n);
        final List<List<Long>> trees = forest.stream()
            .map(list -> list.stream()
                .map(costs::get)
                .sorted()
                .collect(Collectors.toList()))
            .collect(Collectors.toList());

        final long answer = trees.stream()
            .mapToLong(list -> list.get(0))
            .sum()
            + trees.stream()
            .filter(list -> list.size() > 1)
            .flatMap(list -> list.subList(1, list.size()).stream())
            .sorted()
            .limit(2 * (n - m - 1) - trees.size())
            .mapToLong(Long::longValue)
            .sum();
        System.out.println(answer);
    }

    private static List<List<Integer>> makeForest(final List<Edge> edges, final int n) {
        final UnionFindTree tree = new UnionFindTree(n);
        for (final Edge edge : edges) {
            tree.unit(edge.nodeA, edge.nodeB);
        }

        return new ArrayList<>(IntStream.range(0, n)
            .boxed()
            .collect(Collectors.groupingBy(tree::getRoot))
            .values());
    }

    private static class Edge {
        final int nodeA;
        final int nodeB;

        Edge(final int nodeA, final int nodeB) {
            this.nodeA = nodeA;
            this.nodeB = nodeB;
        }
    }

    private static class UnionFindTree {
        private final Integer[] nodes;
        private final List<Integer> indices = new ArrayList<>();

        UnionFindTree(final int numOfNodes) {
            this.nodes = init(numOfNodes);
        }

        private Integer[] init(final int numOfNodes) {
            return IntStream.range(0, numOfNodes)
                .boxed()
                .toArray(Integer[]::new);
        }

        /**
         * 引数のノードが属している木の根を返す．
         *
         * @param nodeNumber ノードの番号
         * @return 根，つまり属している集合の中の一番小さい値
         */
        int getRoot(final int nodeNumber) {
            final int rootNode = nodes[nodeNumber];
            if (rootNode == nodeNumber) {
                for (final Integer index : indices) {
                    nodes[index] = rootNode;
                }
                indices.clear();
                return nodeNumber;
            }

            indices.add(nodeNumber);
            return getRoot(rootNode);
        }

        /**
         * 引数のノードが属する集合を合体させる．
         *
         * @param nodeA ノード
         * @param nodeB ノード
         */
        void unit(final int nodeA, final int nodeB) {
            final int rootA = getRoot(nodeA);
            final int rootB = getRoot(nodeB);

            if (rootA == rootB) {
                return;
            }

            nodes[Math.max(rootA, rootB)] = Math.min(rootA, rootB);
        }
    }

    private static class FastScanner {
        private final BufferedReader reader;
        private StringTokenizer tokenizer;

        FastScanner(final InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
        }

        String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (final IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        int nextInt() {
            return Integer.parseInt(next());
        }
    }
}
