Ken loves ken-ken-pa (Japanese version of hopscotch). Today, he will play it on a directed graph G. G consists of N vertices numbered 1 to N, and M edges. The i-th edge points from Vertex u_i to Vertex v_i.

First, Ken stands on Vertex S. He wants to reach Vertex T by repeating ken-ken-pa. In one ken-ken-pa, he does the following exactly three times: follow an edge pointing from the vertex on which he is standing.

Determine if he can reach Vertex T by repeating ken-ken-pa. If the answer is yes, find the minimum number of ken-ken-pa needed to reach Vertex T. Note that visiting Vertex T in the middle of a ken-ken-pa does not count as reaching Vertex T by repeating ken-ken-pa.

Constraints

* 2 \leq N \leq 10^5
* 0 \leq M \leq \min(10^5, N (N-1))
* 1 \leq u_i, v_i \leq N(1 \leq i \leq M)
* u_i \neq v_i (1 \leq i \leq M)
* If i \neq j, (u_i, v_i) \neq (u_j, v_j).
* 1 \leq S, T \leq N
* S \neq T

Input

Input is given from Standard Input in the following format:


N M
u_1 v_1
:
u_M v_M
S T


Output

If Ken cannot reach Vertex T from Vertex S by repeating ken-ken-pa, print -1. If he can, print the minimum number of ken-ken-pa needed to reach vertex T.

Examples

Input

4 4
1 2
2 3
3 4
4 1
1 3


Output

2


Input

3 3
1 2
2 3
3 1
1 2


Output

-1


Input

2 0
1 2


Output

-1


Input

6 8
1 2
2 3
3 4
4 5
5 1
1 4
1 5
4 6
1 6


Output

2
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.PriorityQueue;
import java.io.IOException;
import java.util.Comparator;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        EHopscotchAddict solver = new EHopscotchAddict();
        solver.solve(1, in, out);
        out.close();
    }

    static class EHopscotchAddict {
        PrintWriter out;
        InputReader in;
        final Comparator<Tuple> com = new Comparator<Tuple>() {
            public int compare(Tuple t1, Tuple t2) {
                if (t1.x != t2.x)
                    return Integer.compare(t1.x, t2.x);
                else if (t1.z != t2.z)
                    return Integer.compare(t2.z, t2.z);
                else
                    return Integer.compare(t1.y, t2.y);
            }
        };

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            this.out = out;
            this.in = in;
            int n = ni();
            int m = ni();
            ArrayList<Integer>[] digraph = new ArrayList[n];
            int i = 0;
            for (i = 0; i < n; i++)
                digraph[i] = new ArrayList<>();
            for (i = 0; i < m; i++) {
                int u = ni() - 1;
                int v = ni() - 1;
                digraph[u].add(v);
            }
            int s = ni() - 1;
            int t = ni() - 1;
            int[][] dist = new int[n][3];
            for (i = 0; i < n; i++)
                Arrays.fill(dist[i], (int) 1e9);
            PriorityQueue<Tuple> pq = new PriorityQueue<>(com);
            pq.add(new Tuple(0, s, 0));
            dist[s][0] = 0;
            while (pq.size() > 0) {
                Tuple curr = pq.poll();
                //if (dist[curr.y][curr.z] != curr.x)
                  //  continue;
                for (int u : digraph[curr.y]) {
                    if (dist[u][(curr.z + 1) % 3] > dist[curr.y][curr.z] + 1) {
                        dist[u][(curr.z + 1) % 3] = dist[curr.y][curr.z] + 1;
                        pq.add(new Tuple(dist[u][(curr.z + 1) % 3], u, (curr.z + 1) % 3));
                    }
                }
            }
            if (dist[t][0] == (int) 1e9 || dist[t][0] % 3 != 0)
                pn(-1);
            else
                pn(dist[t][0] / 3);
        }

        int ni() {
            return in.nextInt();
        }

        void pn(long zx) {
            out.println(zx);
        }

        class Tuple {
            int x;
            int y;
            int z;

            Tuple(int a, int b, int c) {
                x = a;
                y = b;
                z = c;
            }

        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1)
                throw new UnknownError();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new UnknownError();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

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

        public String next() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuffer res = new StringBuffer();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));

            return res.toString();
        }

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }
}

