#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int n, m, k;
vector<int> adj[N], sp;
vector<int> dis1, disn;
vector<int> find_dis(int start) {
  vector<int> dis(n + 1);
  for (int i = 1; i <= n; i++) dis[i] = 1e9;
  queue<int> q;
  q.push(start);
  dis[start] = 0;
  while (!q.empty()) {
    int node = q.front();
    q.pop();
    for (auto to : adj[node]) {
      if (dis[node] + 1 < dis[to]) dis[to] = dis[node] + 1, q.push(to);
    }
  }
  return dis;
}
bool comp(const int &a, const int &b) {
  int x = dis1[a] - disn[a];
  int y = dis1[b] - disn[b];
  return x <= y;
}
void solve() {
  cin >> n >> m >> k;
  for (int i = 0; i < k; i++) {
    int in;
    cin >> in;
    sp.push_back(in);
  }
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    adj[a].push_back(b), adj[b].push_back(a);
  }
  dis1 = find_dis(1);
  disn = find_dis(n);
  vector<pair<int, int> > lol;
  vector<int> suff(k);
  for (int i = 0; i < k; i++) {
    lol.push_back({dis1[sp[i]] - disn[sp[i]], sp[i]});
  }
  sort(lol.begin(), lol.end());
  suff[k - 1] = disn[lol[k - 1].second];
  for (int i = k - 2; ~i; i--) suff[i] = max(suff[i + 1], disn[lol[i].second]);
  int ans = 0;
  for (int i = 0; i < k - 1; i++) {
    ans = max(ans, suff[i + 1] + 1 + dis1[lol[i].second]);
  }
  cout << min(ans, dis1[n]) << "\n";
}
int main() {
  solve();
  return 0;
}
