#include <bits/stdc++.h>
using namespace std;
const int N = 100000;
const int inf = (int)1e9 + 1;
const long long big = (long long)1e18 + 1;
const int P = 239;
const int MOD = (int)1e9 + 7;
const int MOD1 = (int)1e9 + 9;
const double eps = 1e-9;
const double pi = atan2(0, -1);
const int ABC = 26;
int p[N], r[N];
void build(int n) {
  for (int i = 0; i < n; i++) {
    p[i] = i;
    r[i] = 0;
  }
}
int get(int x) {
  if (p[x] != x) p[x] = get(p[x]);
  return p[x];
}
void uni(int x, int y) {
  x = get(x);
  y = get(y);
  if (x == y) return;
  if (r[x] >= r[y])
    p[y] = x;
  else
    p[x] = y;
  if (r[x] == r[y]) r[x]++;
}
vector<int> g[N];
int d[N];
int id[N];
queue<int> q;
void bfs(int len) {
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    if (d[u] == len) continue;
    for (int v : g[u])
      if (d[v] == inf) {
        d[v] = d[u] + 1;
        id[v] = id[u];
        q.push(v);
      } else {
        if (d[v] + d[u] + 1 <= len) uni(id[v], id[u]);
      }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.precision(20);
  int n, m, k;
  cin >> n >> m >> k;
  vector<int> pos;
  for (int i = 0; i < k; i++) {
    int x;
    cin >> x;
    pos.push_back(x - 1);
  }
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  int s, t;
  cin >> s >> t;
  s--;
  t--;
  pos.push_back(t);
  int l = 0, r = n, mid;
  while (r - l > 1) {
    mid = (l + r) / 2;
    build(n);
    fill(d, d + n, inf);
    for (int i : pos) {
      d[i] = 0;
      id[i] = i;
      q.push(i);
    }
    bfs(mid);
    if (get(s) == get(t))
      r = mid;
    else
      l = mid;
  }
  cout << (r < n ? r : -1) << "\n";
  return 0;
}
