#include <bits/stdc++.h>
using namespace std;
int N, M, S, T, K, d[500005], fr[500005], par[500005];
bool ranger[500005];
vector<int> V[500005];
vector<pair<int, pair<int, int> > > edgelist;
queue<int> Q;
int fp(int x) {
  if (par[x] == x)
    return x;
  else
    return par[x] = fp(par[x]);
}
void merge(int x, int y) {
  x = fp(x);
  y = fp(y);
  par[x] = y;
}
int main() {
  scanf("%d%d%d", &N, &M, &K);
  for (int i = 0; i < K; i++) {
    int x;
    scanf("%d", &x);
    x--;
    ranger[x] = 1;
  }
  for (int i = 0; i < M; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    a--;
    b--;
    V[a].push_back(b);
    V[b].push_back(a);
  }
  scanf("%d%d", &S, &T);
  S--;
  T--;
  ranger[T] = 1;
  memset(d, 63, sizeof(d));
  for (int i = 0; i < N; i++) {
    if (ranger[i]) {
      d[i] = 0;
      fr[i] = i;
      Q.push(i);
    }
  }
  while (!Q.empty()) {
    int node = Q.front();
    Q.pop();
    for (int i = 0; i < V[node].size(); i++) {
      int newnode = V[node][i], newdist = d[node] + 1;
      if (d[newnode] >= 1000000000) {
        d[newnode] = newdist;
        fr[newnode] = fr[node];
        Q.push(newnode);
      }
    }
  }
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < V[i].size(); j++) {
      int from = i, to = V[i][j];
      if (fr[from] != fr[to])
        edgelist.push_back(
            make_pair(d[from] + d[to] + 1, make_pair(fr[from], fr[to])));
    }
  }
  sort(edgelist.begin(), edgelist.end());
  for (int i = 0; i < N; i++) par[i] = i;
  for (int i = 0; i < edgelist.size(); i++) {
    if (fp(edgelist[i].second.first) == fp(edgelist[i].second.second)) continue;
    merge(edgelist[i].second.first, edgelist[i].second.second);
    if (fp(S) == fp(T)) {
      printf("%d\n", edgelist[i].first);
      return 0;
    }
  }
  printf("-1\n");
}
