#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 200005;
int n, m, k;
vector<int> graph[MAX_N];
int X[MAX_N], Y[MAX_N];
void bfs(int ini, int *dist) {
  dist[ini] = 0;
  queue<int> q;
  q.push(ini);
  while (!q.empty()) {
    int head = q.front();
    q.pop();
    for (auto son : graph[head]) {
      if (dist[son] != -1) continue;
      dist[son] = dist[head] + 1;
      q.push(son);
    }
  }
}
int main() {
  memset(X, -1, sizeof(X));
  memset(Y, -1, sizeof(Y));
  scanf("%d %d %d", &n, &m, &k);
  vector<int> special;
  for (int i = 0; i < k; i++) {
    int tmp;
    scanf("%d", &tmp);
    special.push_back(tmp - 1);
  }
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    a--, b--;
    graph[a].push_back(b);
    graph[b].push_back(a);
  }
  bfs(0, X);
  bfs(n - 1, Y);
  vector<pair<int, int> > v;
  for (auto sp : special) {
    v.push_back({X[sp] - Y[sp], sp});
  }
  sort(v.begin(), v.end());
  int max_y = INT_MIN;
  int max_x = INT_MIN;
  int max_dist = 0;
  for (auto it : v) {
    max_dist = max(max_dist, min(Y[it.second] + max_x, X[it.second] + max_y));
    max_y = max(max_y, Y[it.second]);
    max_x = max(max_x, X[it.second]);
  }
  printf("%d\n", min(max_dist + 1, X[n - 1]));
  return 0;
}
