#include <bits/stdc++.h>
using namespace std;
int i, n, tt[300000], a[300000], k, pt[500000], hd[300000], nt[500000], m, kk,
    v[300000], d[300000][3], q[3000000], t, h, x, y, Mx;
void add(int x, int y) {
  ++kk;
  nt[kk] = hd[x];
  hd[x] = kk;
  pt[kk] = y;
}
void Bfs(int x, int y) {
  for (i = 1; i <= n; ++i) d[i][y] = 1e9;
  t = 1;
  h = 0;
  q[t] = x;
  d[x][y] = 0;
  while (h < t) {
    h++;
    for (int i = hd[q[h]]; i; i = nt[i])
      if (d[q[h]][y] + 1 < d[pt[i]][y]) {
        d[pt[i]][y] = d[q[h]][y] + 1;
        if (!v[pt[i]]) q[++t] = pt[i], v[pt[i]] = 1;
      }
    v[q[h]] = 0;
  }
}
bool cmp(int x, int y) { return d[x][1] < d[y][1]; }
int main() {
  cin >> n >> m >> k;
  for (i = 1; i <= k; ++i) scanf("%d", &a[i]);
  for (i = 1; i <= m; ++i) scanf("%d%d", &x, &y), add(x, y), add(y, x);
  Bfs(1, 1);
  Bfs(n, 2);
  sort(a + 1, a + k + 1, cmp);
  for (i = 1; i < k; ++i) Mx = max(d[a[i]][1] + d[a[i + 1]][2] + 1, Mx);
  cout << min(Mx, d[n][1]);
}
