#include <bits/stdc++.h>
using namespace std;
void frepik() {}
const int root = (int)1;
const int N = (int)1e5 + 1;
const int logN = (int)18;
const int inf = (int)(1 << 30);
int n, m, k;
int start, finish;
vector<int> g[N];
vector<int> volunteers;
bool was[N];
int p[N];
int sz[N];
int get(int v) {
  if (p[v] == v) return v;
  return p[v] = get(p[v]);
}
void unite(int x, int y) {
  x = get(x);
  y = get(y);
  if (!(sz[x] < sz[y])) swap(x, y);
  sz[y] += sz[x];
  p[x] = y;
}
void refresh() {
  for (int v = 1; v <= n; v++) {
    was[v] = false;
    p[v] = v;
    sz[v] = 1;
  }
}
bool check(int pwr) {
  int power = pwr;
  int lvl_L = 1;
  int lvl_R = 1;
  vector<int> q[N];
  int d[N];
  for (int i = 1; i <= n; i++) d[i] = -1;
  for (auto volunteer : volunteers)
    q[1].push_back(volunteer), was[volunteer] = true, d[volunteer] = 0;
  while (lvl_L <= lvl_R && pwr--) {
    bool did = false;
    vector<int> vertices = q[lvl_L];
    for (auto vertex : vertices) {
      if (d[vertex] >= power) continue;
      for (auto to : g[vertex]) {
        if (!was[to]) {
          was[to] = true;
          q[!did ? ++lvl_R : lvl_R].push_back(to);
          did = true;
          p[to] = vertex, d[to] = d[vertex] + 1;
        } else if (d[vertex] + d[to] + 1 <= power && get(vertex) != get(to))
          unite(get(to), get(vertex));
      }
    }
    lvl_L++;
  }
  return (get(start) == get(finish));
}
int main() {
  frepik();
  bool b[N];
  for (int i = 0; i < N; i++) b[i] = false;
  scanf("%d %d %d", &n, &m, &k);
  for (int i = 1; i <= k; i++) {
    int v;
    scanf("%d", &v);
    b[v] = true;
    volunteers.push_back(v);
  }
  for (int i = 1; i <= m; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  scanf("%d %d", &start, &finish);
  if (!b[finish]) volunteers.push_back(finish);
  int l = 1;
  int r = n;
  int Q = -1;
  while (l <= r) {
    int q = (l + r) / 2;
    refresh();
    if (check(q))
      r = q - 1, Q = q;
    else
      l = q + 1;
  }
  printf("%d", Q);
  return 0;
}
