#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
int v[MAXN];
vector<int> edges[MAXN];
vector<int> edges2[MAXN];
int ver[MAXN];
int res[MAXN];
bool vis[MAXN];
void dfs(int i) {
  vis[i] = true;
  for (int j = 0; j < (int)(edges2[i].size()); j++) {
    int to = edges2[i][j];
    if (!vis[to]) dfs(to);
  }
}
bool fill(int n, int m, int k, int Q, int s, int t) {
  memset(ver, -1, sizeof ver);
  queue<int> q;
  for (int i = 0; i < k; i++) {
    int source = v[i];
    ver[source] = source;
    res[source] = Q;
    q.push(source);
  }
  for (int i = 0; i < n; i++) edges2[i].clear();
  while (!q.empty()) {
    int h = q.front();
    q.pop();
    for (int j = 0; j < (int)(edges[h].size()); j++) {
      int to = edges[h][j];
      if (ver[to] == -1) {
        if (res[h] > 0) {
          ver[to] = ver[h];
          res[to] = res[h] - 1;
          q.push(to);
        }
      } else {
        if (Q - res[to] + Q - res[h] + 1 <= Q) {
          edges2[ver[h]].push_back(ver[to]);
          edges2[ver[to]].push_back(ver[h]);
        }
      }
    }
  }
  memset(vis, false, sizeof vis);
  dfs(s);
  return vis[t];
}
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 0; i < k; i++) cin >> v[i], --v[i];
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    --u, --v;
    edges[u].push_back(v);
    edges[v].push_back(u);
  }
  int s, t;
  cin >> s >> t;
  --s, --t;
  v[k++] = s;
  v[k++] = t;
  sort(v, v + k);
  k = unique(v, v + k) - v;
  int lo = 1, hi = n + 1, res = -1;
  while (lo <= hi) {
    int mid = (lo + hi) >> 1;
    if (fill(n, m, k, mid, s, t))
      res = mid, hi = mid - 1;
    else
      lo = mid + 1;
  }
  cout << res;
  return 0;
}
