#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
const int inf = 1e9;
int n, m, k;
int s[maxn];
int h[2][maxn];
bool ver;
vector<int> G[maxn];
void bfs(int w, int rt) {
  queue<int> Q;
  Q.push(w);
  h[rt][w] = 0;
  while (!Q.empty()) {
    int v = Q.front();
    Q.pop();
    for (int u : G[v]) {
      if (h[rt][u] == -1) {
        h[rt][u] = h[rt][v] + 1;
        Q.push(u);
      }
    }
  }
}
bool cmp(int a, int b) { return h[0][a] > h[0][b]; }
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n >> m >> k;
  for (int i = 0; i < k; i++) {
    cin >> s[i];
    s[i]--;
  }
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    G[u].push_back(v);
    G[v].push_back(u);
  }
  memset(h, -1, sizeof h);
  bfs(0, 0);
  bfs(n - 1, 1);
  sort(s, s + k, cmp);
  int best = inf;
  for (int i = 0; i < k - 1; i++) {
    int tmp = h[0][s[i]] - h[0][s[i + 1]] - 1;
    tmp -= h[1][s[i]] - (h[0][n - 1] - h[0][s[i]]);
    best = min(best, tmp);
  }
  best = max(best, 0);
  cout << h[0][n - 1] - best << '\n';
}
