#include <bits/stdc++.h>
using namespace std;
const long long maxn = 2e5 + 10;
const long long mod = 1e9 + 7;
const long long inf = 8e18;
vector<int> G[maxn];
bool visited[maxn];
bool vi[maxn];
int s[maxn];
int d[maxn];
int n, m, k, u, v;
int e, t;
void dfs(vector<pair<int, int> > p[maxn], int x) {
  vi[x] = 1;
  for (int j = 0; j != p[x].size(); j++) {
    if (vi[p[x][j].first] == 0) dfs(p, p[x][j].first);
  }
}
bool f(int x) {
  vector<pair<int, int> > C[maxn];
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < G[i].size(); j++) {
      if (s[i] != s[G[i][j]] && d[i] + d[G[i][j]] + 1 <= x) {
        C[s[i]].push_back({s[G[i][j]], d[i] + d[G[i][j]] + 1});
        C[s[G[i][j]]].push_back({s[i], d[i] + d[G[i][j]] + 1});
      }
    }
  }
  memset(vi, 0, sizeof(vi));
  dfs(C, e);
  return vi[t];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> k;
  queue<int> pq;
  for (int i = 0; i != k; i++) {
    cin >> u;
    pq.push(u);
    s[u] = u;
    visited[u] = 1;
  }
  for (int i = 0; i != m; i++) {
    cin >> u >> v;
    G[u].push_back(v);
    G[v].push_back(u);
  }
  cin >> e >> t;
  if (s[t] != t) {
    pq.push(t);
    s[t] = t;
    visited[t] = 1;
  }
  while (!pq.empty()) {
    u = pq.front();
    pq.pop();
    for (int j = 0; j != G[u].size(); j++) {
      if (!visited[G[u][j]]) {
        visited[G[u][j]] = 1;
        pq.push(G[u][j]);
        s[G[u][j]] = s[u];
        d[G[u][j]] = d[u] + 1;
      }
    }
  }
  int l = 1, r = n - 1, mid;
  while (r > l) {
    mid = (l + r) / 2;
    if (f(mid))
      r = mid;
    else
      l = mid + 1;
  }
  if (!f(l))
    cout << -1;
  else
    cout << l;
  return 0;
}
