#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
const int maxm = 2e5 + 10;
const int INF = 1 << 30;
int o;
struct node {
  int id, c;
  friend bool operator<(const node &a, const node &b) { return a.c > b.c; }
} f;
int p[maxn];
struct Edge {
  int a, b, c;
  int nxt;
} e[maxm * 2];
int key[maxn];
int n, m, k;
int dis[maxn];
int vis[maxn];
void init() {
  o = 0;
  memset(p, -1, sizeof(p));
  memset(key, 0, sizeof(key));
}
void insert(int u, int v, int w) {
  e[o].b = v;
  e[o].c = w;
  e[o].nxt = p[u];
  p[u] = o;
  o++;
}
int spfa(int s, int t) {
  int ans = 0;
  priority_queue<node> q;
  for (int i = 1; i <= n; i++) dis[i] = INF;
  memset(vis, 0, sizeof(vis));
  dis[s] = 0;
  f.c = 0;
  f.id = s;
  q.push(f);
  while (!q.empty()) {
    f = q.top();
    q.pop();
    int u = f.id;
    ans = max(ans, dis[u]);
    if (key[u] == 1) dis[u] = 0;
    if (u == t) return ans;
    for (int i = p[u]; i != -1; i = e[i].nxt) {
      int v = e[i].b, w = e[i].c;
      if (dis[v] > dis[u] + w) {
        dis[v] = dis[u] + w;
        f.id = v;
        f.c = dis[v];
        q.push(f);
      }
    }
  }
  if (dis[t] == INF) return -1;
}
int main() {
  while (scanf("%d%d%d", &n, &m, &k) != EOF) {
    init();
    for (int i = 0; i < k; i++) {
      int x;
      scanf("%d", &x);
      key[x] = 1;
    }
    for (int i = 0; i < m; i++) {
      int u, v;
      scanf("%d%d", &u, &v);
      insert(u, v, 1);
      insert(v, u, 1);
    }
    int s, t;
    scanf("%d%d", &s, &t);
    printf("%d\n", spfa(s, t));
  }
  return 0;
}
