#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int par[N], d[N];
vector<int> graph[N];
vector<pair<int, int>> gr[N];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m, k;
  cin >> n >> m >> k;
  queue<int> q;
  while (k--) {
    int x;
    cin >> x;
    q.push(x);
    par[x] = x;
  }
  while (m--) {
    int x, y;
    cin >> x >> y;
    graph[x].push_back(y);
    graph[y].push_back(x);
  }
  int s, t;
  cin >> s >> t;
  q.push(t);
  par[t] = t;
  while (!q.empty()) {
    int v = q.front();
    q.pop();
    for (int u : graph[v]) {
      if (par[u] == 0) {
        par[u] = par[v];
        d[u] = d[v] + 1;
        q.push(u);
      }
    }
  }
  for (int v = 1; v <= n; ++v) {
    for (int u : graph[v]) {
      if (par[u] != par[v]) gr[par[v]].emplace_back(par[u], d[v] + d[u] + 1);
    }
  }
  vector<int> dd(n + 1, INT_MAX / 2);
  dd[s] = 0;
  priority_queue<pair<int, int>, vector<pair<int, int>>,
                 greater<pair<int, int>>>
      pq;
  pq.emplace(0, s);
  while (!pq.empty()) {
    int v = pq.top().second, c = pq.top().first;
    pq.pop();
    if (c > dd[v]) continue;
    for (pair<int, int> e : gr[v]) {
      if (dd[e.first] <= max(c, e.second)) continue;
      dd[e.first] = max(c, e.second);
      pq.emplace(dd[e.first], e.first);
    }
  }
  cout << (dd[t] == INT_MAX / 2 ? -1 : dd[t]);
  return 0;
}
