#include <bits/stdc++.h>
using namespace std;
struct edge {
  int u, v, c;
};
inline bool operator<(const edge& a, const edge& b) { return a.c < b.c; }
const int N = 100003;
int d[N], q[N];
vector<int> adj[N];
edge e[2 * N];
int p[N];
int find(int x) { return x != p[x] ? p[x] = find(p[x]) : x; }
void link(int x, int y) {
  x = find(x);
  y = find(y);
  p[x] = y;
}
int main() {
  int n, m, k;
  scanf("%d%d%d", &n, &m, &k);
  queue<int> Q;
  while (k--) {
    int u;
    scanf("%d", &u);
    d[u] = 0;
    q[u] = u;
    Q.push(u);
  }
  for (int i = 0; i < m; ++i) {
    scanf("%d%d", &e[i].u, &e[i].v);
    adj[e[i].u].push_back(e[i].v);
    adj[e[i].v].push_back(e[i].u);
  }
  int s, t;
  scanf("%d%d", &s, &t);
  if (!p[t]) {
    d[t] = 0;
    q[t] = t;
    Q.push(t);
  }
  while (!Q.empty()) {
    int u = Q.front();
    Q.pop();
    for (vector<int>::iterator it = adj[u].begin(); it != adj[u].end(); ++it)
      if (!q[*it]) {
        d[*it] = d[u] + 1;
        q[*it] = q[u];
        Q.push(*it);
      }
  }
  for (int i = 0; i < m;) {
    if (q[e[i].u] && q[e[i].v]) {
      e[i].c = d[e[i].u] + d[e[i].v] + 1;
      e[i].u = q[e[i].u];
      e[i].v = q[e[i].v];
      ++i;
    } else
      swap(e[i], e[--m]);
  }
  sort(e, e + m);
  for (int u = 1; u <= n; ++u) p[u] = u;
  int i = -1;
  while (find(s) != find(t)) {
    if (++i == m) break;
    link(e[i].u, e[i].v);
  }
  if (i < m)
    printf("%d\n", e[i].c);
  else
    puts("-1");
  return 0;
}
