#include <bits/stdc++.h>
using namespace std;
int n, m, k;
const int N = 203600 * 4;
vector<int> adj[N];
vector<int> bck[N];
void ae(int first, int second) {
  adj[first].push_back(second);
  adj[second].push_back(first);
}
int p[N];
int F(int first) {
  if (p[first] == first) return first;
  return p[first] = F(p[first]);
}
vector<int> vec;
bool good[N];
int q[N];
int d[N];
int hd, tl;
void Push(int first, int c, int second) {
  int py = F(second);
  int px = F(first);
  if (py != px) {
    p[px] = py;
  }
  if (d[first] != -1) return;
  d[first] = c;
  q[tl++] = first;
}
int main() {
  while (cin >> n >> m >> k) {
    while (k--) {
      int first;
      cin >> first;
      vec.push_back(first);
    }
    for (int r = (1); r <= (int)(m); r++) {
      int first, second;
      cin >> first >> second;
      ++n;
      ae(first, n);
      ae(n, second);
    }
    int st, ed;
    cin >> st >> ed;
    vec.push_back(ed);
    good[st] = good[ed] = true;
    for (int i = (1); i <= (int)(n); i++) p[i] = i;
    memset(d, -1, sizeof(d));
    hd = tl = 0;
    for (__typeof((vec).begin()) it = (vec).begin(); it != (vec).end(); it++)
      Push(*it, 0, *it);
    bool sol = false;
    for (int r = (0); r <= (int)(n); r++) {
      if (F(st) == F(ed)) {
        cout << r << endl;
        sol = true;
        break;
      }
      if (sol || hd == tl) break;
      while (d[q[hd]] == r) {
        int first = q[hd];
        hd++;
        for (__typeof((adj[first]).begin()) it = (adj[first]).begin();
             it != (adj[first]).end(); it++) {
          Push(*it, r + 1, first);
        }
      }
    }
    if (!sol) cout << -1 << endl;
  }
  return 0;
}
