#include <bits/stdc++.h>
using namespace std;
vector<int> adjl[200000];
int level11[200000];
int level22[200000];
int visited11[200000];
int visited22[200000];
void bfs1(int s) {
  visited11[s]++;
  queue<int> q;
  q.push(s);
  while (!q.empty()) {
    int a = q.front();
    q.pop();
    for (int i = 0; i < adjl[a].size(); i++) {
      if (visited11[adjl[a][i]] == 0) {
        visited11[adjl[a][i]]++;
        q.push(adjl[a][i]);
        level11[adjl[a][i]] = level11[a] + 1;
      }
    }
  }
}
void bfs2(int s) {
  visited22[s]++;
  queue<int> q;
  q.push(s);
  while (!q.empty()) {
    int a = q.front();
    q.pop();
    for (int i = 0; i < adjl[a].size(); i++) {
      if (visited22[adjl[a][i]] == 0) {
        visited22[adjl[a][i]]++;
        q.push(adjl[a][i]);
        level22[adjl[a][i]] = level22[a] + 1;
      }
    }
  }
}
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  int arr[k];
  for (int i = 0; i < k; i++) {
    cin >> arr[i];
  }
  vector<pair<int, int>> level1;
  vector<int> level2;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    adjl[x - 1].push_back(y - 1);
    adjl[y - 1].push_back(x - 1);
  }
  bfs1(0);
  bfs2(n - 1);
  int ans = level11[n - 1];
  for (int i = 0; i < k; i++) {
    level1.push_back(make_pair(level11[arr[i] - 1] - level22[arr[i] - 1],
                               level22[arr[i] - 1]));
  }
  sort(level1.begin(), level1.end());
  int maxi = -1;
  int dp[k];
  for (int i = k - 1; i >= 0; i--) {
    int x = level1[i].second;
    if (x > maxi) {
      maxi = x;
    }
    dp[i] = maxi;
  }
  int max1 = -1;
  for (int i = 0; i < (k - 1); i++) {
    int y = level1[i].second + level1[i].first;
    if (min(ans, (y + dp[i + 1] + 1)) > max1) {
      max1 = min(ans, y + dp[i + 1] + 1);
    }
  }
  cout << max1;
}
