#include <bits/stdc++.h>
using namespace std;
bool vis[200005];
vector<int> v[200005], ak, d1, dn;
vector<int> bfs(int n) {
  queue<int> q;
  vector<int> dis(200005);
  q.push(n);
  vis[n] = true;
  dis[n] = 0;
  while (!q.empty()) {
    int x = q.front();
    q.pop();
    for (int i = 0; i < v[x].size(); i++) {
      int u = v[x][i];
      if (vis[u] == false) {
        vis[u] = true;
        dis[u] = dis[x] + 1;
        q.push(u);
      }
    }
  }
  return dis;
}
bool cmp(int x, int y) { return d1[x] < d1[y]; }
int main() {
  int n, m, k, n1, n2, sp, ans = 0;
  scanf("%d %d %d", &n, &m, &k);
  for (int i = 0; i < k; i++) {
    scanf("%d", &sp);
    ak.push_back(sp);
  }
  for (int i = 0; i < m; i++) {
    scanf("%d %d", &n1, &n2);
    v[n1].push_back(n2);
    v[n2].push_back(n1);
  }
  d1 = bfs(1);
  memset(vis, false, sizeof(vis));
  dn = bfs(n);
  sort(ak.begin(), ak.end(), cmp);
  for (int i = 1; i < ak.size(); i++) {
    int x = ak[i - 1];
    int y = ak[i];
    ans = max(ans, d1[x] + 1 + dn[y]);
  }
  ans = min(ans, d1[n]);
  printf("%d\n", ans);
  return 0;
}
