#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 10;
const int INF = 1e9 + 10;
vector<int> vertex[MAXN];
vector<pair<int, pair<int, int> > > edge;
queue<pair<int, int> > q;
int e[MAXN];
int dist[MAXN];
int head[MAXN];
int max_edge[MAXN];
bool pmp[MAXN];
int n;
void bfs() {
  for (int i = 1; i <= n; i++) {
    dist[i] = INF;
    if (pmp[i]) {
      dist[i] = 0;
      q.push(make_pair(i, i));
    }
  }
  while (!q.empty()) {
    int v = q.front().first, u = q.front().second;
    e[v] = u;
    q.pop();
    for (int i = 0; i < vertex[v].size(); i++) {
      if (dist[vertex[v][i]] == INF) {
        dist[vertex[v][i]] = dist[v] + 1;
        q.push(make_pair(vertex[v][i], u));
      }
    }
  }
}
void update(int v) {
  if (head[head[v]] != head[head[head[v]]]) {
    update(head[v]);
  }
  head[v] = head[head[v]];
}
void dsu(int v, int u, int w) {
  update(v);
  update(u);
  if (head[v] == head[u]) {
    return;
  }
  max_edge[head[v]] = max(w, max(max_edge[head[v]], max_edge[head[u]]));
  head[head[u]] = head[v];
}
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(0);
  int m, k;
  cin >> n >> m >> k;
  for (int i = 0; i < k; i++) {
    int x;
    cin >> x;
    pmp[x] = true;
  }
  for (int i = 0; i < m; i++) {
    int v, u;
    cin >> v >> u;
    vertex[v].push_back(u);
    vertex[u].push_back(v);
  }
  int s, t;
  cin >> s >> t;
  pmp[t] = true;
  bfs();
  for (int i = 1; i <= n; i++) {
    head[i] = i;
    max_edge[i] = 0;
    for (int j = 0; j < vertex[i].size(); j++) {
      if (e[i] != e[vertex[i][j]]) {
        edge.push_back(make_pair(dist[i] + dist[vertex[i][j]] + 1,
                                 make_pair(e[i], e[vertex[i][j]])));
      }
    }
  }
  sort(edge.begin(), edge.end());
  for (int i = 0; i < edge.size(); i++) {
    int v = edge[i].second.first, u = edge[i].second.second, w = edge[i].first;
    dsu(v, u, w);
    update(s);
    update(t);
    if (head[s] == head[t]) {
      cout << max_edge[head[s]];
      return 0;
    }
  }
  cout << -1;
}
