#include <bits/stdc++.h>
using namespace std;
const int M = 2e5 + 5, C = 4e2 + 5;
int node, cost, newcost;
int dest[M], dest2[M];
priority_queue<pair<int, int>> pq;
vector<int> graph[M];
void dijkstra() {
  pq.push({0, 1});
  dest[1] = 0;
  while (!pq.empty()) {
    node = pq.top().second;
    cost = -pq.top().first;
    pq.pop();
    if (cost > dest[node]) {
      continue;
    }
    for (auto i : graph[node]) {
      newcost = cost + 1;
      if (newcost < dest[i]) {
        pq.push({-newcost, i});
        dest[i] = newcost;
      }
    }
  }
}
void dijkstra2(int start) {
  pq.push({0, start});
  dest2[start] = 0;
  while (!pq.empty()) {
    node = pq.top().second;
    cost = -pq.top().first;
    pq.pop();
    if (cost > dest2[node]) {
      continue;
    }
    for (auto i : graph[node]) {
      newcost = cost + 1;
      if (newcost < dest2[i]) {
        pq.push({-newcost, i});
        dest2[i] = newcost;
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++) {
    dest[i] = dest2[i] = 1e9;
  }
  int sp[k + 5];
  for (int i = 0; i < k; i++) {
    cin >> sp[i];
  }
  int x, y;
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    graph[x].push_back(y);
    graph[y].push_back(x);
  }
  dijkstra();
  x = dest[n];
  dijkstra2(n);
  vector<pair<int, int>> v2;
  for (int i = 0; i < k; i++) {
    v2.push_back({dest2[sp[i]], sp[i]});
  }
  sort(v2.begin(), v2.end());
  int mx = 0;
  for (int i = 0; i < v2.size() - 1; i++) {
    if (mx < 1 + dest[v2[i + 1].second] + v2[i].first) {
      mx = 1 + dest[v2[i + 1].second] + v2[i].first;
    }
  }
  cout << min(dest[n], mx);
  return 0;
}
