#include <bits/stdc++.h>
using namespace std;
int n, m, V, S, T, v[100100], isV[100100], d[100100], f[100100];
vector<int> a[100100];
void bfs() {
  queue<int> q;
  d[S] = 1;
  q.push(S);
  while (!q.empty()) {
    int x = q.front();
    q.pop();
    for (int i = 0; i < int(a[x].size()); i++) {
      int y = a[x][i];
      if (!d[y]) d[y] = d[x] + 1, q.push(y);
    }
  }
}
int possible(int val) {
  queue<int> q;
  for (int i = 1; i <= n; i++) f[i] = -1, d[i] = 0;
  f[S] = val;
  q.push(S);
  while (!q.empty()) {
    int x = q.front();
    q.pop();
    if (x == T) return 1;
    if (d[x] || !f[x]) continue;
    d[x] = 1;
    for (int i = 0; i < int(a[x].size()); i++) {
      int y = a[x][i], F = (isV[y] ? val : f[x] - 1);
      if (F > f[y]) f[y] = F, q.push(y), d[y] = 0;
    }
  }
  return 0;
}
int main() {
  int x, y;
  cin >> n >> m >> V;
  for (int i = 0; i < V; i++) scanf("%d", v + i), isV[v[i]] = 1;
  while (m--) {
    scanf("%d%d", &x, &y);
    a[x].push_back(y);
    a[y].push_back(x);
  }
  cin >> S >> T;
  bfs();
  if (!d[T]) {
    puts("-1");
    return 0;
  }
  int low = 1, high = d[T], ans = high;
  while (low <= high) {
    int mid = (low + high) / 2;
    if (possible(mid))
      high = mid - 1, ans = mid;
    else
      low = mid + 1;
  }
  cout << ans << endl;
}
