#include <bits/stdc++.h>
using namespace std;
const long long BINF = 9e18, LINF = 2e9, P = 179, Q = 1791791791;
map<long long, long long> compress(vector<long long> a) {
  sort(a.begin(), a.end());
  a.resize(unique(a.begin(), a.end()) - a.begin());
  map<long long, long long> make_pair;
  for (long long i = 0; i < a.size(); ++i) make_pair[a[i]] = i;
  return make_pair;
}
const long long MAXN = 2e5 + 7;
vector<long long> g[MAXN];
long long a[MAXN], d1[MAXN], d2[MAXN];
pair<long long, long long> first[MAXN];
long long f[MAXN];
void solve() {
  long long n, m, k;
  cin >> n >> m >> k;
  for (long long i = 0; i < k; ++i) {
    cin >> a[i];
    --a[i];
  }
  for (long long i = 0; i < m; ++i) {
    long long a, b;
    cin >> a >> b;
    --a, --b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  queue<long long> q;
  fill(d1, d1 + n, 2 * MAXN);
  q.push(0);
  d1[0] = 0;
  while (q.size()) {
    long long v = q.front();
    q.pop();
    for (long long u : g[v]) {
      if (d1[u] > d1[v] + 1) {
        d1[u] = d1[v] + 1;
        q.push(u);
      }
    }
  }
  fill(d2, d2 + n, 2 * MAXN);
  q.push(n - 1);
  d2[n - 1] = 0;
  while (q.size()) {
    long long v = q.front();
    q.pop();
    for (long long u : g[v]) {
      if (d2[u] > d2[v] + 1) {
        d2[u] = d2[v] + 1;
        q.push(u);
      }
    }
  }
  for (long long i = 0; i < k; ++i) first[i] = {d1[a[i]], d2[a[i]]};
  f[k - 1] = first[k - 1].second;
  for (long long i = k - 2; i >= 0; --i) f[i] = max(f[i + 1], first[i].second);
  sort(first, first + k);
  long long ans = 0;
  for (long long i = 0; i < k; ++i) {
    long long a = first[i].first;
    long long b = first[i].second;
    long long l = 0, r = 1e9;
    while (r - l > 1) {
      long long m = (l + r) / 2;
      long long minx = m - b;
      long long ps = (long long)(upper_bound(first, first + i,
                                             pair<long long, long long>{
                                                 minx, (long long)-1e9}) -
                                 first);
      if (ps == i) {
        r = m;
        continue;
      }
      long long maxy = f[ps];
      if (maxy + a >= m)
        l = m;
      else
        r = m;
    }
    ans = max(ans, l);
  }
  cout << min(ans + 1, d1[n - 1]);
  return;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cout.precision(40);
  long long t;
  t = 1;
  for (long long i = 0; i < t; ++i) solve();
  return 0;
}
