#include <bits/stdc++.h>
using namespace std;
int n, m, k;
int s, t;
struct par {
  int d, zr;
};
vector<int> f;
void Stworz(int n) {
  f.clear();
  for (int i = 0; i < n; ++i) f.push_back(i);
}
int Find(int a) {
  if (f[a] == a) return a;
  int fa = Find(f[a]);
  f[a] = fa;
  return fa;
}
void Union(int a, int b) {
  int fa = Find(a);
  int fb = Find(b);
  if (fa != fb) f[fa] = fb;
}
bool Spr(int q, vector<vector<int> >& G, vector<int>& sp, vector<bool>& jest) {
  Stworz(n);
  queue<int> Q;
  vector<par> odl(n, {-1, -1});
  for (int i = 0; i < k; ++i) {
    Q.push(sp[i]);
    odl[sp[i]] = {0, sp[i]};
  }
  while (!Q.empty()) {
    int akt = Q.front();
    Q.pop();
    for (int i = 0; i < G[akt].size(); ++i) {
      if (odl[G[akt][i]].d == -1) {
        odl[G[akt][i]] = {odl[akt].d + 1, odl[akt].zr};
        Q.push(G[akt][i]);
      }
    }
  }
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < G[i].size(); ++j)
      if (odl[i].d + odl[G[i][j]].d + 1 <= q && odl[i].d != -1 &&
          odl[G[i][j]].d != -1)
        Union(odl[i].zr, odl[G[i][j]].zr);
  vector<int> odl2(n, -1);
  Q.push(t);
  odl2[t] = 0;
  while (!Q.empty()) {
    int akt = Q.front();
    Q.pop();
    for (int i = 0; i < G[akt].size(); ++i) {
      if (odl2[G[akt][i]] == -1) {
        odl2[G[akt][i]] = odl2[akt] + 1;
        Q.push(G[akt][i]);
        if (jest[G[akt][i]] && Find(G[akt][i]) == Find(s) &&
            odl2[G[akt][i]] <= q)
          return true;
      }
    }
  }
  return false;
}
int main() {
  scanf("%d %d %d", &n, &m, &k);
  vector<int> sp(k);
  vector<bool> jest(n, false);
  for (int i = 0; i < k; ++i) {
    scanf("%d", &sp[i]);
    --sp[i];
    jest[sp[i]] = true;
  }
  vector<vector<int> > G(n);
  for (int i = 0; i < m; ++i) {
    int a, b;
    scanf("%d %d", &a, &b);
    --a;
    --b;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  scanf("%d %d", &s, &t);
  --s;
  --t;
  int l = 1, p = 1000000, s, r = -1;
  while (l <= p) {
    s = (l + p) / 2;
    if (Spr(s, G, sp, jest)) {
      r = s;
      p = s - 1;
    } else
      l = s + 1;
  }
  printf("%d", r);
  return 0;
}
