#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
const int inf = 1000 * 1000 * 1000;
const int mod = 998244353;
mt19937 myrand(chrono::steady_clock::now().time_since_epoch().count());
int n, m, k;
bool used[N];
vector<int> g[N];
int st[3];
int d[3][N];
int main() {
  cin >> n >> m >> k;
  for (int i = 1; i <= k; i++) {
    int a;
    scanf("%d", &a);
    used[a] = true;
  }
  for (int i = 1; i <= m; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    g[a].push_back(b);
    g[b].push_back(a);
  }
  st[0] = 1;
  st[1] = n;
  for (int h = 0; h < 2; h++) {
    for (int i = 1; i <= n; i++) {
      d[h][i] = -1;
    }
    queue<int> q;
    q.push(st[h]);
    d[h][st[h]] = 0;
    while (!q.empty()) {
      int v = q.front();
      q.pop();
      for (int i = 0; i < (int)g[v].size(); i++) {
        int to = g[v][i];
        if (d[h][to] != -1) continue;
        q.push(to);
        d[h][to] = d[h][v] + 1;
      }
    }
  }
  vector<pair<int, int> > V;
  multiset<int> q;
  for (int i = 1; i <= n; i++) {
    V.push_back(make_pair(d[0][i] - d[1][i], i));
    if (used[i]) {
      q.insert(d[1][i]);
    }
  }
  sort(V.begin(), V.end());
  int res = 0;
  for (int i = 0; i < n; i++) {
    int v = V[i].second;
    if (used[v]) {
      q.erase(q.find(d[1][v]));
      if ((int)q.size()) {
        multiset<int>::iterator it = q.end();
        --it;
        res = max(res, *it + d[0][v] + 1);
      }
    }
  }
  cout << min(res, d[0][n]) << endl;
  return 0;
}
