#include <bits/stdc++.h>
using namespace std;
const int M = 500010, mod = 1000000007;
vector<int> A[M];
int dist[M];
int visited[M];
int parent[M];
queue<int> q;
int f(int u) { return parent[u] = parent[u] == u ? u : f(parent[u]); }
void add(int u, int v) {
  u = f(u);
  v = f(v);
  if (u != v) parent[u] = v;
}
int main() {
  ios_base::sync_with_stdio(false);
  int n, m, st, ed;
  int i, j, k;
  memset((visited), (0), sizeof(visited));
  scanf("%d%d%d", &n, &m, &k);
  while (k--) {
    scanf("%d", &j);
    visited[j] = 1;
    dist[j] = 0;
    q.push(j);
  }
  int fake = n + 1;
  while (m--) {
    scanf("%d%d", &i, &j);
    A[i].push_back(fake);
    A[fake].push_back(i);
    A[j].push_back(fake);
    A[fake].push_back(j);
    fake++;
  }
  scanf("%d%d", &st, &ed);
  visited[ed] = 1;
  dist[ed] = 0;
  q.push(ed);
  for (i = 0; i < M; i++) parent[i] = i;
  for (int d = 0; !q.empty(); d++) {
    while (!q.empty()) {
      int u = q.front();
      if (dist[u] > d) break;
      q.pop();
      for (int v : A[u]) {
        add(u, v);
        if (!visited[v]) {
          visited[v] = 1;
          dist[v] = dist[u] + 1;
          q.push(v);
        }
      }
    }
    if (f(st) == f(ed)) {
      printf("%d\n", d + 1);
      return 0;
    }
  }
  printf("%d\n", -1);
  return 0;
}
