#include <bits/stdc++.h>
using namespace std;
const long long maxN = 2e5 + 5, MOD = 1e9 + 7, INF = 1e9 + 1;
const double PI = acos(-1), EPS = 1e-7;
int n, m, k, a, b, q, s, t, vol[maxN];
vector<int> G[maxN], rG[maxN];
vector<int> nodes;
int dist[maxN];
vector<int> tam, parent;
void dsu() {
  tam.assign(maxN, 1);
  parent.assign(maxN, 0);
  for (int i = int(0); i < int(maxN); i++) {
    parent[i] = i;
  }
}
int findSet(int i) {
  return parent[i] == i ? i : parent[i] = findSet(parent[i]);
}
bool sameSet(int i, int j) { return findSet(i) == findSet(j); }
void unionSet(int a, int b) {
  a = findSet(a);
  b = findSet(b);
  if (a != b) {
    if (tam[a] < tam[b]) swap(a, b);
    parent[b] = a;
    tam[a] += tam[b];
  }
}
bool pos(int q) {
  queue<int> Q;
  for (int x : nodes) {
    Q.push(x);
    dist[x] = 0;
  }
  while (((int)Q.size())) {
    int u = Q.front();
    Q.pop();
    if (dist[u] >= q) continue;
    for (int v : G[u]) {
      if (dist[v] == -1) {
        dist[v] = dist[u] + 1;
        unionSet(v, u);
        Q.push(v);
      } else if (dist[v] + dist[u] < q) {
        unionSet(v, u);
      }
    }
  }
  return sameSet(s, t);
}
void init() {
  memset(dist, -1, sizeof dist);
  dsu();
}
int main() {
  cin >> n >> m >> k;
  for (int i = int(0); i < int(k); i++) {
    cin >> vol[i];
    vol[i]--;
    nodes.push_back(vol[i]);
  }
  for (int i = int(0); i < int(m); i++) {
    cin >> a >> b;
    a--, b--;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  cin >> s >> t;
  s--, t--;
  nodes.push_back(s);
  nodes.push_back(t);
  int lo = 0, hi = n + m, mid;
  q = -1;
  while (lo <= hi) {
    mid = lo + hi;
    mid /= 2;
    init();
    if (pos(mid)) {
      q = mid;
      hi = mid - 1;
    } else {
      lo = mid + 1;
    }
  }
  cout << q << '\n';
  return 0;
}
