#include <bits/stdc++.h>
using namespace std;
int m, n, k, lab[100005], d[100005], ll[100005];
vector<int> s[100005];
int S, T, x, u, v;
queue<int> q;
int find(int u) {
  if (lab[u] <= 0) return u;
  int res = find(lab[u]);
  lab[u] = res;
  return res;
}
void UNION(int u, int v) {
  u = find(u), v = find(v);
  if (u == v) return;
  if (lab[u] < lab[v])
    lab[v] = u;
  else if (lab[u] > lab[v])
    lab[u] = v;
  else
    lab[u] = v, lab[v]--;
}
bool check(int r) {
  memset(lab, 0, sizeof(lab));
  for (int u = 1; u <= n; u++)
    for (typeof(s[u].begin()) v = s[u].begin(); v != s[u].end(); v++)
      if (d[u] + d[*v] + 1 <= r) UNION(ll[u], ll[*v]);
  if (find(S) == find(T)) return true;
  return false;
}
int main() {
  cin >> n >> m >> k;
  memset(d, 0, sizeof(d));
  memset(ll, 0, sizeof(ll));
  for (int i = 1; i <= k; i++) {
    scanf("%d", &x);
    q.push(x);
    d[x] = 0;
    ll[x] = x;
  }
  for (int i = 1; i <= m; i++)
    scanf("%d%d", &u, &v), s[u].push_back(v), s[v].push_back(u);
  cin >> S >> T;
  if (!d[S]) d[S] = 0, q.push(S), ll[S] = S;
  if (!d[T]) d[T] = 0, q.push(T), ll[T] = T;
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (typeof(s[u].begin()) v = s[u].begin(); v != s[u].end(); v++)
      if (ll[*v] == 0) {
        d[*v] = d[u] + 1;
        ll[*v] = ll[u];
        q.push(*v);
      }
  }
  int l = 0, h = n;
  while (l + 1 < h) {
    int mid = (l + h) / 2;
    if (check(mid))
      h = mid;
    else
      l = mid + 1;
  }
  if (check(l))
    cout << l;
  else if (check(h))
    cout << h;
  else
    cout << -1;
  return 0;
}
