#include <bits/stdc++.h>
using namespace std;
long long int n, m, k;
map<long long int, long long int> pos;
map<long long int, vector<long long int> > g;
vector<long long int> bfs(int s) {
  queue<int> q;
  q.push(s);
  vector<long long int> dis(n + 1, -1);
  dis[s] = 0;
  while (q.size()) {
    int x = q.front();
    q.pop();
    for (int i = 0; i < g[x].size(); i++) {
      int c = g[x][i];
      if (dis[c] == -1) {
        dis[c] = dis[x] + 1;
        q.push(c);
      }
    }
  }
  return dis;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m >> k;
  for (int i = 0; i < k; i++) {
    long long int x;
    cin >> x;
    pos[x] = 1;
  }
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  vector<long long int> x = bfs(1);
  vector<long long int> y = bfs(n);
  vector<pair<long long int, long long int> > pos1;
  for (int i = 1; i <= n; i++) {
    if (pos[i]) {
      pos1.push_back({x[i] - y[i], i});
    }
  }
  long long int ans = -1, mx = -1e6;
  sort(pos1.begin(), pos1.end());
  for (int i = pos1.size() - 1; i >= 0; i--) {
    ans = max(ans, mx + x[pos1[i].second] + 1);
    mx = max(mx, y[pos1[i].second]);
  }
  ans = min(ans, x[n]);
  cout << ans;
}
