#include <bits/stdc++.h>
#pragma GCC optimize(3)
using namespace std;
const long long mod = 998244353;
const long double eps = 1e-9;
const long double PI = acos(-1.0);
struct bian {
  int to, cost;
};
bool operator<(bian a, bian b) { return a.cost > b.cost; }
vector<bian> edge[201000];
int kmark[201000], diss[201000], dist[201000];
int n, m, k;
struct item {
  int id, v, w;
} tto[201000];
int cnt, maxto[201000], maxtod[201000], secto[201000], sectod[201000];
void dijkstra(int s, int dis[]) {
  for (int i = 1; i <= n; i++) {
    dis[i] = 1000000000;
  }
  dis[s] = 0;
  priority_queue<bian> que;
  que.push({s, 0});
  while (!que.empty()) {
    if (dis[que.top().to] != que.top().cost) {
      que.pop();
      continue;
    }
    int temp = que.top().to;
    que.pop();
    for (auto i : edge[temp]) {
      if (dis[i.to] > dis[temp] + (i.cost)) {
        dis[i.to] = dis[temp] + (i.cost);
        que.push((bian){i.to, dis[i.to]});
      }
    }
  }
}
int find_(int x) {
  int l = 1, r = cnt + 1, mid;
  while (l < r) {
    mid = (l + r) / 2;
    if (tto[mid].w < x)
      l = mid + 1;
    else
      r = mid;
  }
  return l;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  memset(maxto, -1, sizeof(maxto));
  memset(secto, -1, sizeof(secto));
  cin >> n >> m >> k;
  for (int i = 1, x; i <= k; i++) {
    cin >> x;
    kmark[x] = 1;
  }
  for (int i = 1, u, v; i <= m; i++) {
    cin >> u >> v;
    edge[u].push_back((bian){v, 1});
    edge[v].push_back((bian){u, 1});
  }
  dijkstra(1, diss);
  dijkstra(n, dist);
  for (int i = 1; i <= n; i++) {
    if (!kmark[i]) continue;
    tto[++cnt].id = i, tto[cnt].v = dist[i], tto[cnt].w = diss[i] - dist[i];
  }
  sort(tto + 1, tto + 1 + cnt, [](item a, item b) { return a.w < b.w; });
  tto[cnt + 1].w = 1000000000;
  for (int i = cnt; i >= 1; i--) {
    maxto[i] = maxto[i + 1], maxtod[i] = maxtod[i + 1];
    secto[i] = secto[i + 1], sectod[i] = sectod[i + 1];
    if (tto[i].v >= maxto[i]) {
      secto[i] = maxto[i], sectod[i] = maxtod[i];
      maxto[i] = tto[i].v, maxtod[i] = tto[i].id;
    } else if (tto[i].v > secto[i]) {
      secto[i] = tto[i].v, sectod[i] = tto[i].id;
    }
  }
  int maxsd = 0, maxtd = 0, maxres = -1;
  for (int i = 1; i <= n; i++) {
    if (!kmark[i]) continue;
    int l = find_(diss[i] - dist[i]), buf;
    if (maxtod[l] == i)
      buf = sectod[l];
    else
      buf = maxtod[l];
    if (buf != 0 && diss[i] + dist[buf] > maxres)
      maxres = diss[i] + dist[buf], maxsd = i, maxtd = buf;
  }
  edge[maxsd].push_back((bian){maxtd, 1});
  edge[maxtd].push_back((bian){maxsd, 1});
  dijkstra(1, diss);
  cout << diss[n];
  return 0;
}
