#include <bits/stdc++.h>
using namespace std;
struct rec {
  int next, other;
} e[4000010];
int n, m, p, i, x, y, st, en, l, r, mid, tot, head[1500010], f[1500010];
queue<int> h;
void add(int x, int y) {
  e[++tot].next = head[x];
  head[x] = tot;
  e[tot].other = y;
  e[++tot].next = head[y];
  head[y] = tot;
  e[tot].other = x;
}
int find(int x) {
  if (f[x] == x)
    return x;
  else
    return f[x] = find(f[x]);
}
void Union(int x, int y) { f[find(y)] = find(x); }
void bfs(int step) {
  int cnt = 0, u, v, i;
  while (cnt < step) {
    cnt++;
    u = h.front();
    i = head[u];
    while (i) {
      v = e[i].other;
      if (find(u) != find(v)) {
        Union(v, u);
        h.push(v);
      }
      i = e[i].next;
    }
    h.pop();
  }
}
void Add(int x, int y) {
  add(x, ++n);
  add(n, y);
}
int main() {
  scanf("%d%d%d", &n, &m, &p);
  for (i = 1; i <= p; i++) {
    scanf("%d", &x);
    h.push(x);
  }
  for (i = 1; i <= m; i++) {
    scanf("%d%d", &x, &y);
    Add(x, y);
  }
  scanf("%d%d", &st, &en);
  h.push(en);
  if (st == en)
    printf("0\n");
  else {
    for (i = 1; i <= n; i++) f[i] = i;
    for (i = 1; i <= n; i++) {
      bfs(h.size());
      if (find(st) == find(en)) break;
    }
    if (i != n + 1)
      printf("%d\n", i);
    else
      printf("-1\n");
  }
  return 0;
}
