#include <bits/stdc++.h>
using namespace std;
long long add(long long a, long long b) {
  a += b;
  if (a >= 1000000007) {
    a -= 1000000007;
  }
  return a;
}
long long sub(long long a, long long b) {
  a -= b;
  if (a < 0) {
    a += 1000000007;
  }
  return a;
}
long long mul(long long a, long long b) { return (a * b) % 1000000007; }
void add_self(long long& a, long long b) { a = add(a, b); }
void sub_self(long long& a, long long b) { a = sub(a, b); }
void mul_self(long long& a, long long b) { a = mul(a, b); }
using namespace std;
const long long N = 1e5 + 10, INF = 1e9;
bool mark[N];
vector<long long> adj[N], g[N];
long long n, m, k, s, t;
long long d[N], st, en, que[N];
bool vis[N];
void dfs(long long v) {
  vis[v] = true;
  for (auto u : g[v])
    if (!vis[u]) dfs(u);
}
bool check(long long q) {
  st = en = 0;
  for (long long i = 1; i <= n; i++) {
    d[i] = INF;
  }
  for (long long i = 1; i <= n; i++) {
    if (mark[i]) {
      d[i] = 0;
      que[en++] = i;
    }
  }
  while (en - st > 0) {
    long long v = que[st++];
    for (auto u : adj[v]) {
      if (d[u] == INF) {
        d[u] = d[v] + 1;
        que[en++] = u;
      }
    }
  }
  for (long long i = 1; i <= n; i++) {
    g[i].clear();
  }
  for (long long v = 1; v <= n; v++) {
    for (auto u : adj[v]) {
      if (d[u] + d[v] <= q - 1) {
        g[v].push_back(u);
      }
    }
  }
  memset(vis, 0, sizeof vis);
  dfs(s);
  return vis[t];
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m >> k;
  for (long long i = 0; i < k; i++) {
    long long v;
    cin >> v;
    mark[v] = true;
  }
  for (long long i = 0; i < m; i++) {
    long long u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  cin >> s >> t;
  mark[t] = true;
  if (s == t) {
    return cout << 0 << endl, 0;
  }
  long long lo = 0, hi = n;
  while (hi - lo > 1) {
    long long mid = (lo + hi) / 2;
    if (check(mid)) {
      hi = mid;
    } else
      lo = mid;
  }
  if (hi == n) {
    return cout << -1 << endl, 0;
  }
  return cout << hi << endl, 0;
}
