#include <bits/stdc++.h>
using namespace std;
const int N = 1 << 17;
int n, m, k, guide[N];
bool has_guide[N];
vector<int> v[N], g[N];
int aghakljghkja, hoahgkjaga, middle;
int dist[N];
bool used[N];
int source[N], s, t;
void dfs(int node) {
  used[node] = true;
  int i;
  for (i = 0; i < (int)(g[node].size()); i++)
    if (!used[g[node][i]]) dfs(g[node][i]);
}
bool check(int d) {
  int i;
  queue<int> q;
  int curr;
  for (i = 1; i <= n; i++) g[i].clear();
  memset(used, 0, sizeof(used));
  for (i = 1; i <= k; i++)
    if (!used[guide[i]])
      used[guide[i]] = true, dist[guide[i]] = 0, q.push(guide[i]),
      source[guide[i]] = guide[i];
  while (!q.empty()) {
    curr = q.front();
    q.pop();
    for (i = 0; i < (int)(v[curr].size()); i++) {
      if (!used[v[curr][i]]) {
        dist[v[curr][i]] = dist[curr] + 1;
        used[v[curr][i]] = true;
        q.push(v[curr][i]);
        source[v[curr][i]] = source[curr];
      } else {
        if (dist[curr] + dist[v[curr][i]] + 1 <= d) {
          g[source[curr]].push_back(source[v[curr][i]]),
              g[source[v[curr][i]]].push_back(source[curr]);
        }
      }
    }
  }
  memset(used, 0, sizeof(used));
  dfs(s);
  return used[t];
}
int main() {
  int i, x, y;
  scanf("%d %d %d", &n, &m, &k);
  for (i = 1; i <= k; i++) scanf("%d", &guide[i]), has_guide[guide[i]] = true;
  for (i = 1; i <= m; i++)
    scanf("%d %d", &x, &y), v[x].push_back(y), v[y].push_back(x);
  scanf("%d %d", &s, &t);
  if (!has_guide[t]) has_guide[t] = true, guide[++k] = t;
  aghakljghkja = -1;
  hoahgkjaga = n + 3;
  if (!check(hoahgkjaga)) {
    printf("-1\n");
    return 0;
  }
  while (hoahgkjaga - aghakljghkja > 1) {
    middle = (aghakljghkja + hoahgkjaga) >> 1;
    if (check(middle))
      hoahgkjaga = middle;
    else
      aghakljghkja = middle;
  }
  printf("%d\n", hoahgkjaga);
  return 0;
}
