#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
const int INF = (int)1e9;
int n, m, q;
int a[N];
int d[2][N];
vector<int> adj[N];
void BFS(int s, int *d) {
  for (int i = 1; i <= n; ++i) d[i] = INF;
  d[s] = 0;
  queue<int> Q;
  Q.push(s);
  while (Q.size()) {
    int u = Q.front();
    Q.pop();
    for (int v : adj[u]) {
      if (d[v] == INF) {
        d[v] = d[u] + 1;
        Q.push(v);
      }
    }
  }
}
int main() {
  cin >> n >> m >> q;
  for (int i = 1; i <= q; ++i) cin >> a[i];
  for (int i = 1; i <= m; ++i) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  BFS(1, d[0]);
  BFS(n, d[1]);
  sort(a + 1, a + q + 1,
       [&](int x, int y) { return d[0][x] - d[1][x] < d[0][y] - d[1][y]; });
  int ans = -INF;
  int minDist = d[0][n];
  int dist = d[0][a[1]];
  for (int i = 2; i <= q; ++i) {
    int u = a[i];
    int p = dist + d[1][u] + 1;
    if (min(p, minDist) > ans) ans = min(p, minDist);
    dist = max(dist, d[0][u]);
  }
  cout << ans;
  return 0;
}
