#include <bits/stdc++.h>
using namespace std;
vector<int> g[200000 + 1];
int n, m, k;
vector<int> a;
void dij(int i, vector<int> &d) {
  vector<int> v(n + 1, 0);
  v[i] = 1;
  d[i] = 0;
  queue<int> q;
  q.push(i);
  while (!q.empty()) {
    int j = q.front();
    q.pop();
    for (int u : g[j]) {
      if (!v[u]) {
        v[u] = 1;
        d[u] = 1 + d[j];
        q.push(u);
      }
    }
  }
}
void solve() {
  cin >> n >> m >> k;
  a.assign(k, 0);
  for (int i = 0; i < k; i++) cin >> a[i];
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  vector<int> d1(n + 1, 0), d2(n + 1, 0);
  dij(1, d1);
  dij(n, d2);
  vector<pair<int, int>> temp;
  for (int i = 0; i < k; i++) {
    temp.push_back({d1[a[i]] - d2[a[i]], a[i]});
  }
  sort(temp.begin(), temp.end());
  int ans = -1;
  int suff[200000 + 1];
  suff[k] = 0;
  for (int i = k - 1; i >= 0; i--) {
    suff[i] = max(d2[temp[i].second], suff[i + 1]);
  }
  for (int i = 0; i < k - 1; i++) {
    ans = max(ans, d1[temp[i].second] + suff[i + 1] + 1);
  }
  cout << min(d1[n], ans);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int t;
  solve();
  return 0;
}
