#include <bits/stdc++.h>
using namespace std;
const int maxx = 2e5 + 20, inf = 1e9 + 2;
int start, dest, n, m, l, r, k, mark[maxx], a[maxx], d[maxx], src[maxx];
bool vis2[maxx], vis[maxx];
vector<int> adj[maxx], ad2[maxx];
queue<int> q;
void dfs(int root) {
  vis2[root] = true;
  for (int x : ad2[root])
    if (!vis2[x]) dfs(x);
}
bool bfs(int w) {
  for (int i = 0; i < n; i++) ad2[i].clear();
  fill(d, d + maxx, inf);
  fill(src, src + maxx, -1);
  fill(vis, vis + maxx, false);
  fill(vis2, vis2 + maxx, false);
  for (int i = 0; i < k + 2; i++)
    d[a[i]] = 0, q.push(a[i]), src[a[i]] = a[i], vis[a[i]] = true;
  while (q.size()) {
    int x = q.front();
    q.pop();
    for (int y : adj[x]) {
      if (!vis[y]) {
        d[y] = d[x] + 1, vis[y] = true, src[y] = src[x], q.push(y);
      } else if (src[x] != src[y] && d[x] + d[y] + 1 <= w) {
        int e1 = src[x], e2 = src[y];
        ad2[e1].push_back(e2);
        ad2[e2].push_back(e1);
      }
    }
  }
  dfs(start);
  return vis2[dest];
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> k;
  for (int i = 0; i < k; i++) {
    int x;
    cin >> x;
    x--;
    a[i] = x;
  }
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  cin >> start >> dest;
  start--, dest--;
  a[k] = start;
  a[k + 1] = dest;
  l = 0, r = n + 1;
  while (l + 1 != r) {
    int mid = (l + r) / 2;
    if (bfs(mid))
      r = mid;
    else
      l = mid;
  }
  cout << (r == n + 1 ? -1 : r) << endl;
  return 0;
}
