#include <bits/stdc++.h>
using namespace std;
const int maxn = 4e5 + 5, M = 200, bghs = 1e9 + 7, inf = 1e9;
vector<int> adj[maxn];
queue<int> q;
int par[maxn], path[maxn], n, m, k, ans = inf, s, t;
int gpc(int v) { return par[v] < 0 ? v : par[v] = gpc(par[v]); }
void mrg(int u, int v) {
  u = gpc(u);
  v = gpc(v);
  if (u == v) return;
  if (u < v) swap(u, v);
  par[v] += par[u];
  par[u] = v;
}
void bfs() {
  if (!path[t]) {
    path[t] = 1;
    q.push(t);
  }
  while (!q.empty()) {
    int v = q.front();
    for (auto u : adj[v]) {
      mrg(u, v);
      if (!path[u]) {
        path[u] = path[v] + 1;
        q.push(u);
      }
      if (gpc(s) == gpc(t)) {
        ans = path[u];
        return;
      }
    }
    q.pop();
  }
}
int main() {
  memset(par, -1, sizeof par);
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 0; i < k; i++) {
    int v;
    scanf("%d", &v);
    path[v] = 1;
    q.push(v);
  }
  for (int i = 0; i < m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    adj[u].push_back(i + n + 1);
    adj[i + n + 1].push_back(u);
    adj[v].push_back(i + n + 1);
    adj[i + n + 1].push_back(v);
  }
  scanf("%d%d", &s, &t);
  bfs();
  cout << ((ans == inf) ? -1 : ans - 1) << endl;
}
