#include <bits/stdc++.h>
using namespace std;
const int maxN = 100000 + 10;
int n, m, k, s, t;
bool vol[maxN];
vector<int> a[maxN];
int qu[maxN], top, bot;
int d[maxN], p[maxN], root[maxN];
void enter() {
  scanf("%d%d%d", &n, &m, &k);
  int u, v;
  memset(vol, false, sizeof vol);
  for (int i = 0; i < k; i++) {
    scanf("%d", &u);
    vol[u] = true;
  }
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &u, &v);
    a[u].push_back(v);
    a[v].push_back(u);
  }
  scanf("%d%d", &s, &t);
  vol[t] = true;
}
int getp(int u) {
  while (p[u] != u) u = p[u] = p[p[u]];
  return u;
}
void unite(int u, int v) {
  u = getp(u);
  v = getp(v);
  if (u == v) return;
  p[u] = v;
}
bool check(int q) {
  for (int i = 1; i <= n; i++) p[i] = i;
  memset(root, 0, sizeof root);
  bot = 1;
  top = 0;
  memset(d, -1, sizeof d);
  for (int i = 1; i <= n; i++)
    if (vol[i]) {
      qu[++top] = i;
      root[i] = i;
      d[i] = 0;
    }
  while (bot <= top) {
    int u = qu[bot++];
    for (typeof(a[u].begin()) it = a[u].begin(); it != a[u].end(); it++)
      if (d[*it] == -1) {
        d[*it] = d[u] + 1;
        root[*it] = root[u];
        qu[++top] = *it;
      } else {
        if (d[*it] + d[u] + 1 <= q) {
          unite(root[*it], root[u]);
        }
      }
  }
  return (getp(s) == getp(t));
}
void solve() {
  if (!check(n)) {
    printf("-1\n");
    return;
  }
  int lo = 1, hi = n, mid;
  while (lo < hi) {
    mid = (lo + hi) / 2;
    if (check(mid))
      hi = mid;
    else
      lo = mid + 1;
  }
  printf("%d\n", lo);
}
int main() {
  enter();
  solve();
  return 0;
}
