#include <bits/stdc++.h>
using namespace std;
template <class T>
void chkmax(T& x, T y) {
  x = x > y ? x : y;
}
template <class T>
void chkmin(T& x, T y) {
  x = x < y ? x : y;
}
template <class T>
void read(T& x) {
  x = 0;
  char ch = 0;
  int f = 1;
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = -1;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + (ch ^ 48);
  x *= f;
}
template <class T>
void write(T x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) write(x / 10);
  putchar(x % 10 + 48);
}
template <class T>
void writeln(T x) {
  write(x), puts("");
}
const int N = 2e5 + 5;
int n, m, k;
vector<int> g[N];
int a[N], sufMax[N];
bool vis[N];
struct Node {
  int u, dis;
  Node(int x = 0, int y = 0) { u = x, dis = y; }
  bool operator<(const Node& rhs) const { return dis > rhs.dis; }
};
void dijkstra(int s, vector<int>& dis) {
  for (int i = 0; i < n; i++) dis[i] = 0x3f3f3f3f, vis[i] = 0;
  priority_queue<Node> heap;
  dis[s] = 0, heap.push(Node(s, 0));
  while (!heap.empty()) {
    int u = heap.top().u;
    heap.pop();
    if (vis[u]) continue;
    vis[u] = 1;
    for (auto v : g[u])
      if (dis[v] > dis[u] + 1) {
        dis[v] = dis[u] + 1;
        heap.push(Node(v, dis[v]));
      }
  }
}
int main() {
  read(n), read(m), read(k);
  for (int i = 0; i < k; i++) read(a[i]), a[i]--;
  for (int i = 0; i < m; i++) {
    int u, v;
    read(u), read(v);
    u--, v--;
    g[u].push_back(v), g[v].push_back(u);
  }
  vector<int> disS(n), disE(n);
  dijkstra(0, disS), dijkstra(n - 1, disE);
  sort(a, a + k,
       [&](int x, int y) { return disS[x] - disE[x] < disS[y] - disE[y]; });
  sufMax[0] = -0x3f3f3f3f;
  for (int i = 1; i < k; i++) sufMax[i] = max(sufMax[i - 1], disS[a[i - 1]]);
  int Ans = -0x3f3f3f3f;
  for (int i = 0; i < k; i++) chkmax(Ans, sufMax[i] + disE[a[i]]);
  writeln(min(Ans + 1, disS[n - 1]));
  return 0;
}
