#include <bits/stdc++.h>
using namespace std;
int const N = 3e5 + 20;
int n, m, k, par[N], s, t, dist[N];
bool mark[N];
vector<int> g[N];
queue<int> que;
inline void add_edge(int u, int v, int i) {
  g[u].push_back(i + n), g[i + n].push_back(u), g[v].push_back(i + n),
      g[i + n].push_back(v);
}
int root(int v) { return par[v] < 0 ? v : par[v] = root(par[v]); }
inline void merge(int u, int v) {
  if ((u = root(u)) == (v = root(v))) return;
  par[u] = v;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> k;
  for (int i = 0, u; i < k; i++) cin >> u, mark[--u] = 1, que.push(u);
  for (int i = 0, u, v; i < m; i++) cin >> u >> v, u--, v--, add_edge(u, v, i);
  cin >> s >> t;
  s--, t--;
  if (!mark[t]) mark[t] = 1, que.push(t);
  memset(par, -1, sizeof par);
  for (int i = 0; i < n; i++)
    if (mark[i]) dist[i] = 1;
  while ((int)que.size()) {
    int v = que.front();
    que.pop();
    for (int u : g[v]) {
      merge(u, v);
      if (!dist[u]) {
        dist[u] = dist[v] + 1;
        que.push(u);
        merge(u, v);
      }
    }
    if (root(s) == root(t)) return cout << dist[v] << '\n', 0;
  }
  cout << "-1\n";
}
