#include <bits/stdc++.h>
using namespace std;
const int N_MAX = 100005, M_MAX = 200005;
int N, M, K, S, T;
vector<int> edges[N_MAX];
int volunteers[N_MAX];
int num_reachable;
bool reached[N_MAX];
int reachable[N_MAX];
int global_dists[N_MAX];
int reachable_dists[N_MAX];
void bfs(int* starting_pts, int num_pts, int* dists) {
  for (int i = 0; i < N; i++) dists[i] = -1;
  queue<pair<int, int> > q;
  for (int i = 0; i < num_pts; i++) q.push(pair<int, int>(starting_pts[i], 0));
  while (!q.empty()) {
    pair<int, int> cur = q.front();
    q.pop();
    int node = cur.first, dist = cur.second;
    if (dists[node] != -1 && dists[node] <= dist) continue;
    dists[node] = dist;
    for (int i = 0; i < edges[node].size(); i++)
      q.push(pair<int, int>(edges[node][i], dist + 1));
  }
}
void search_reachable(int x, int q) {
  if (reached[x]) return;
  reached[x] = true;
  if (global_dists[x] == 0) reachable[num_reachable++] = x;
  for (int i = 0; i < edges[x].size(); i++) {
    if (1 + global_dists[x] + global_dists[edges[x][i]] <= q)
      search_reachable(edges[x][i], q);
  }
}
void compute_reachable(int q) {
  num_reachable = 0;
  for (int i = 0; i < N; i++) reached[i] = false;
  search_reachable(S, q);
}
bool can_find(int q) {
  compute_reachable(q);
  for (int i = 0; i < N; i++) reachable_dists[i] = -1;
  bfs(reachable, num_reachable, reachable_dists);
  return (reachable_dists[T] != -1 && reachable_dists[T] <= q);
}
int best_q(int min_q, int max_q) {
  if (min_q == max_q) return min_q;
  int mid = (min_q + max_q) / 2;
  if (can_find(mid)) return best_q(min_q, mid);
  return best_q(mid + 1, max_q);
}
int main() {
  cin >> N >> M >> K;
  for (int i = 0; i < K; i++) {
    cin >> volunteers[i];
    volunteers[i]--;
  }
  for (int i = 0; i < M; i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    edges[x].push_back(y);
    edges[y].push_back(x);
  }
  cin >> S >> T;
  S--;
  T--;
  bfs(volunteers, K, global_dists);
  int answer = best_q(0, N + 5);
  cout << (answer != N + 5 ? answer : -1) << '\n';
}
