#include <bits/stdc++.h>
using namespace std;
vector<int> link(500005);
vector<int> size(500005);
void iniciar(int n) {
  for (int i = (0); i < (int)(n + 1); i++) link[i] = i;
  for (int i = (0); i < (int)(n + 1); i++) size[i] = 1;
}
int find(int x) {
  if (x == link[x]) return x;
  return link[x] = find(link[x]);
}
bool same(int a, int b) { return find(a) == find(b); }
void unite(int a, int b) {
  a = find(a);
  b = find(b);
  if (size[a] < size[b]) swap(a, b);
  size[a] += size[b];
  link[b] = a;
}
vector<vector<int> > g(200005);
vector<bool> visto(200005);
void DFS(int n) {
  visto[n] = true;
  for (auto u : g[n])
    if (!visto[u]) DFS(u);
}
bool BFS(int inicio, int fin, int med, int n, vector<int> &guia) {
  iniciar(n + 5);
  for (int i = (0); i < (int)(n + 5); i++) visto[i] = false;
  vector<int> dist(n + 5, 0);
  vector<int> sup(n + 5, -1);
  queue<pair<int, int> > q;
  for (auto u : guia) {
    q.push({u, u}), visto[u] = true;
    sup[u] = u;
  }
  q.push({fin, fin});
  sup[fin] = fin;
  visto[fin] = true;
  dist[fin] = 0;
  while (q.size() > 0) {
    pair<int, int> u = q.front();
    q.pop();
    for (auto w : g[u.first]) {
      if (dist[u.first] < med) {
        if (visto[w] == false) {
          visto[w] = true;
          q.push({w, u.second});
          sup[w] = u.second;
          dist[w] = dist[u.first] + 1;
        } else if (dist[u.first] + dist[w] + 1 <= med)
          unite(u.second, sup[w]);
      }
    }
  }
  if (same(inicio, fin) == true)
    return true;
  else
    return false;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m, k;
  cin >> n >> m >> k;
  vector<int> guia(k);
  for (int i = (0); i < (int)(k); i++) cin >> guia[i];
  for (int i = (0); i < (int)(m); i++) {
    int x, y;
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  int inicio, fin;
  cin >> inicio >> fin;
  for (int i = (0); i < (int)(n + 1); i++) visto[i] = false;
  DFS(inicio);
  if (visto[fin] == false) {
    cout << "-1\n";
    return 0;
  }
  int a = -1, b = 1000000;
  while (b - a > 1) {
    int med = (a + b) / 2;
    bool d = BFS(inicio, fin, med, n, guia);
    if (d == true)
      b = med;
    else
      a = med;
  }
  cout << b << "\n";
  return 0;
}
