#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m, k;
  cin >> n >> m >> k;
  vector<vector<int>> graf(n);
  set<int> a;
  for (int i = 0; i < k; i++) {
    int x;
    cin >> x;
    x--;
    a.insert(x);
  }
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    graf[x].push_back(y);
    graf[y].push_back(x);
  }
  queue<int> q;
  vector<int> d1(n, -1);
  vector<int> d2(n, -1);
  q.push(0);
  d1[0] = 0;
  while (!q.empty()) {
    int v = q.front();
    q.pop();
    for (auto &i : graf[v]) {
      if (d1[i] == -1) {
        d1[i] = d1[v] + 1;
        q.push(i);
      }
    }
  }
  q.push(n - 1);
  d2[n - 1] = 0;
  while (!q.empty()) {
    int v = q.front();
    q.pop();
    for (auto &i : graf[v]) {
      if (d2[i] == -1) {
        d2[i] = d2[v] + 1;
        q.push(i);
      }
    }
  }
  int mx = d1[n - 1];
  vector<pair<int, int>> x;
  for (auto i : a) {
    x.push_back({d1[i] - d2[i], i});
  }
  sort(x.begin(), x.end());
  int best = 0, tmx = INT_MIN;
  for (auto i : x) {
    best = max(best, tmx + d2[i.second]);
    tmx = max(tmx, d1[i.second]);
  }
  mx = min(mx, best + 1);
  cout << mx;
}
