#include <bits/stdc++.h>
using namespace std;
int n, m, k;
vector<int> G[200010];
int dis[2][200010], a[200010], vis[200010];
void bfs(int x, int st) {
  memset(vis, 0, sizeof(vis));
  for (int i = 1; i <= n; i++) dis[x][i] = 1e9;
  queue<int> Q;
  dis[x][st] = 0;
  vis[st] = 1;
  Q.push(st);
  while (!Q.empty()) {
    int now = Q.front();
    Q.pop();
    for (int i = 0; i < G[now].size(); i++) {
      int nxt = G[now][i];
      if (vis[nxt]) continue;
      dis[x][nxt] = dis[x][now] + 1;
      Q.push(nxt);
      vis[nxt] = 1;
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  int i, j;
  cin >> n >> m >> k;
  for (i = 0; i < k; i++) cin >> a[i];
  for (i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    G[x].push_back(y);
    G[y].push_back(x);
  }
  bfs(0, 1);
  bfs(1, n);
  set<int> S;
  int ans = 0;
  vector<pair<int, int> > V;
  for (i = 0; i < k; i++)
    V.push_back(make_pair(dis[0][a[i]] - dis[1][a[i]], a[i]));
  sort(V.begin(), V.end());
  int tmp = 0;
  for (i = 0; i < V.size(); i++) {
    if (i) {
      ans = max(ans, tmp + dis[1][V[i].second] + 1);
    }
    tmp = max(tmp, dis[0][V[i].second]);
  }
  cout << min(ans, dis[0][n]) << endl;
  return 0;
}
