#include <bits/stdc++.h>
using namespace std;
bool desc(int a, int b) { return (a > b); }
bool pairone(pair<int, int> &a, pair<int, int> &b) {
  return (a.first < b.first);
}
void show(vector<int> vec) {
  for (auto x : vec) cout << x << " ";
  cout << endl;
  ;
}
void bfs_0();
void bfs_n();
vector<int> special;
vector<vector<int>> roads;
vector<int> distn, dist1;
bool compy(int a, int b) {
  return (dist1[a] - distn[a]) < (dist1[b] - distn[b]);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int n, m, k;
  cin >> n >> m >> k;
  roads = vector<vector<int>>(n);
  int temp;
  int i;
  for (i = 0; i < k; i++) {
    cin >> temp;
    temp--;
    special.push_back(temp);
  }
  int a, b;
  for (i = 0; i < m; i++) {
    cin >> a >> b;
    a--;
    b--;
    roads[a].push_back(b);
    roads[b].push_back(a);
  }
  dist1 = distn = vector<int>(n);
  bfs_0();
  bfs_n();
  int shortest = dist1[n - 1];
  vector<int> x, y;
  x = y = special;
  sort(x.begin(), x.end(), compy);
  sort(y.begin(), y.end(), compy);
  int maxi = 0;
  vector<int> suff_y = y;
  for (i = y.size() - 1; i >= 0; i--) {
    maxi = max(maxi, distn[y[i]]);
    suff_y[i] = maxi;
  }
  int maxd = 0;
  for (i = 0; i < x.size() - 1; i++) {
    maxd = max(maxd, dist1[x[i]] + suff_y[i + 1]);
  }
  cout << min(maxd + 1, shortest);
}
void bfs_0() {
  queue<int> nodes;
  nodes.push(0);
  int now;
  while (!nodes.empty()) {
    now = nodes.front();
    for (auto x : roads[now]) {
      if (dist1[x] == 0 && x != 0) {
        dist1[x] = dist1[now] + 1;
        nodes.push(x);
      }
    }
    nodes.pop();
  }
}
void bfs_n() {
  int n = roads.size();
  queue<int> nodes;
  nodes.push(n - 1);
  int now;
  while (!nodes.empty()) {
    now = nodes.front();
    for (auto x : roads[now]) {
      if (distn[x] == 0 && x != (n - 1)) {
        distn[x] = distn[now] + 1;
        nodes.push(x);
      }
    }
    nodes.pop();
  }
}
