#include <bits/stdc++.h>
using namespace std;
const int N = 200 * 10000 + 10;
int n, m, k, s, t, a[N], par[N], h[N];
vector<int> adj[N];
queue<int> q;
bool vis[N];
void bfs() {
  for (int i = 0; i < k; i++) vis[a[i]] = true, q.push(a[i]), par[a[i]] = a[i];
  q.push(t), vis[t] = true, par[t] = t;
  while (!q.empty()) {
    int v = q.front();
    q.pop();
    for (int u : adj[v])
      if (!vis[u]) vis[u] = true, par[u] = par[v], h[u] = h[v] + 1, q.push(u);
  }
}
bool check(int x) {
  fill(vis, vis + n, false);
  q.push(s), vis[s] = true;
  while (!q.empty()) {
    int v = q.front();
    q.pop();
    for (int u : adj[v])
      if (!vis[u] && h[u] + h[v] + 1 <= x) vis[u] = true, q.push(u);
  }
  return vis[t];
}
int main() {
  ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  cin >> n >> m >> k;
  for (int i = 0; i < k; i++) cin >> a[i], --a[i];
  for (int i = 0, u, v; i < m; i++)
    cin >> u >> v, adj[--u].push_back(--v), adj[v].push_back(u);
  cin >> s >> t, --s, --t;
  bfs();
  int l = 0, r = N;
  while (r - l > 1) {
    int mid = l + r >> 1;
    (check(mid)) ? r = mid : l = mid;
  }
  cout << (r ^ N ? r : -1) << '\n';
}
