#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e6 + 9;
queue<int> q;
int d[MAX], n, m, k, s, t, f[MAX];
vector<int> g[MAX];
int root(int v) { return !f[v] ? v : f[v] = root(f[v]); }
void merge(int v, int u) {
  if ((v = root(v)) == (u = root(u))) return;
  f[u] = v;
}
void add(int v, int u) { g[v].push_back(u), g[u].push_back(v); }
int main() {
  cin >> n >> m >> k;
  for (int i = 0, v; i < k; i++) cin >> v, q.push(v), d[v] = 1;
  for (int i = 1, v, u; i <= m; i++)
    cin >> v >> u, add(v, i + n), add(i + n, u);
  cin >> s >> t;
  if (!d[t]) d[t] = 1, q.push(t);
  while (q.size()) {
    int v = q.front();
    q.pop();
    for (auto u : g[v]) {
      merge(v, u);
      if (!d[u]) d[u] = d[v] + 1, q.push(u);
      if (root(s) == root(t)) return cout << d[u] - 1, 0;
    }
  }
  cout << -1;
}
