#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 10;
const int maxn5 = 1e5 + 10;
const int maxnt = 1.2e6 + 10;
const int maxn3 = 1e3 + 10;
const long long mod = 1e9 + 7;
const long long inf = 2e18;
bool mark[maxn5], pr[maxn5];
int n, s, t, lim, h[maxn5], scr[maxn5];
queue<int> q;
vector<int> adj[maxn5];
vector<pair<int, long long>> adj2[maxn5];
map<int, long long> ex[maxn5];
void dfs(int v) {
  mark[v] = true;
  for (auto [u, len] : adj2[v])
    if (len <= lim and !mark[u]) dfs(u);
  return;
}
bool check(int mid) {
  lim = mid;
  fill(mark, mark + n + 10, false);
  dfs(s);
  return mark[t];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int m, k;
  cin >> n >> m >> k;
  fill(h, h + n + 10, -1);
  for (int i = 0; i < k; i++) {
    int a;
    cin >> a;
    pr[a] = true;
    q.push(a);
    h[a] = 0;
    scr[a] = a;
  }
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  cin >> s >> t;
  if (!pr[t]) {
    pr[t] = true;
    q.push(t);
    h[t] = 0;
    scr[t] = t;
  }
  while (!q.empty()) {
    int v = q.front();
    q.pop();
    for (auto u : adj[v])
      if (h[u] == -1) {
        h[u] = h[v] + 1;
        scr[u] = scr[v];
        q.push(u);
      }
  }
  for (int i = 1; i <= n; i++)
    if (scr[i] != 0)
      for (auto u : adj[i]) {
        int v = scr[i];
        if (ex[v].find(scr[u]) == ex[v].end()) ex[v][scr[u]] = h[u] + h[i] + 1;
        ex[v][scr[u]] = min(h[u] + h[i] + 1LL, ex[v][scr[u]]);
      }
  for (int i = 1; i <= n; i++)
    if (pr[i]) {
      for (auto it = ex[i].begin(); it != ex[i].end(); it++)
        adj2[i].push_back({it->first, it->second});
    }
  int lo = 0, hi = maxn;
  while (hi - lo > 1) {
    int mid = (lo + hi) >> 1;
    if (check(mid))
      hi = mid;
    else
      lo = mid;
  }
  cout << (hi == maxn ? -1 : hi) << '\n';
  return 0;
}
