#include <bits/stdc++.h>
using namespace std;
const long double Pi = 3.14159265359;
const long long MOD = 1000 * 1000 * 1000 + 7;
const long long MAXN = 2e5 + 10;
const long long INF = 1e18;
long long mark[MAXN];
vector<long long> adj[MAXN];
long long Vo[MAXN];
long long s, t2;
long long n, m, k;
void DFS(int v) {
  mark[v] = 1;
  for (int i = 0; i < adj[v].size(); i++) {
    if (!mark[adj[v][i]]) DFS(adj[v][i]);
  }
}
pair<long long, long long> mark2[MAXN];
long long d[MAXN], par[MAXN];
long long get_par(int v) {
  if (par[v] == v) return v;
  return par[v] = get_par(par[v]);
}
long long merge(int v, int u) {
  v = get_par(v);
  u = get_par(u);
  par[v] = u;
}
bool isval(int qq) {
  for (int i = 0; i < MAXN; i++) par[i] = i;
  memset(mark2, 0, sizeof mark2);
  queue<int> q;
  memset(d, 0, sizeof d);
  for (int i = 0; i < k; i++) {
    q.push(Vo[i]);
    mark2[Vo[i]].first = 1;
    mark2[Vo[i]].second = Vo[i];
  }
  while (q.size()) {
    long long ru = q.front();
    for (int i = 0; i < adj[ru].size(); i++) {
      if (!mark2[adj[ru][i]].first) {
        q.push(adj[ru][i]);
        d[adj[ru][i]] = d[ru] + 1;
        mark2[adj[ru][i]].second = mark2[ru].second;
        mark2[adj[ru][i]].first = 1;
      } else {
        if (d[adj[ru][i]] + d[ru] + 1 <= qq)
          merge(mark2[ru].second, mark2[adj[ru][i]].second);
      }
    }
    q.pop();
  }
  if (get_par(s) == get_par(t2)) return 1;
  return 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie();
  cout.tie();
  cin >> n >> m >> k;
  map<int, int> ma;
  for (int i = 0; i < k; i++) cin >> Vo[i], ma[Vo[k]] = 1;
  long long t, t1;
  for (int i = 0; i < m; i++) {
    cin >> t >> t1;
    adj[t].push_back(t1);
    adj[t1].push_back(t);
  }
  cin >> s >> t2;
  if (ma[t2] != 1) Vo[k] = t2;
  k++;
  DFS(s);
  if (!mark[t2]) return cout << -1, 0;
  ;
  long long l = 0;
  long long r = n;
  long long mid;
  while (r - l > 1) {
    mid = (l + r) / 2;
    if (isval(mid))
      r = mid;
    else
      l = mid;
  }
  cout << r;
}
