#include <bits/stdc++.h>
using namespace std;
const long long INF = (long long)(1e18);
const long long inf = 1e9 + 7;
long double eps = 1e-8;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
long long mod = 998244353;
struct stree {
  vector<int> t;
  int n = 1;
  stree(int a) {
    while (n <= a) n *= 2;
    t.resize(n + n, -inf);
  }
  void update(int v, int x) {
    v += n;
    t[v] = x;
    v /= 2;
    while (v > 0) {
      t[v] = max(t[v + v], t[v + v + 1]);
      v /= 2;
    }
  }
  int getmax(int l, int r) {
    int res = -inf;
    for (l += n, r += n; l <= r; l /= 2, r /= 2) {
      if (l % 2 == 1) res = max(res, t[l++]);
      if (r % 2 == 0) res = max(res, t[r--]);
    }
    return res;
  }
};
signed main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(0);
  int n, m, k;
  cin >> n >> m >> k;
  vector<vector<int>> g;
  vector<int> aa(k);
  for (int i = 0; i < k; i++) {
    cin >> aa[i];
    aa[i]--;
  }
  g.resize(n);
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  vector<int> d(n, inf), d1(n, inf);
  d[0] = 0;
  queue<int> q;
  q.push(0);
  while (!q.empty()) {
    int v = q.front();
    q.pop();
    for (auto to : g[v]) {
      if (d[to] <= d[v] + 1) continue;
      d[to] = d[v] + 1;
      q.push(to);
    }
  }
  d1[n - 1] = 0;
  q.push(n - 1);
  while (!q.empty()) {
    int v = q.front();
    q.pop();
    for (auto to : g[v]) {
      if (d1[to] <= d1[v] + 1) continue;
      d1[to] = d1[v] + 1;
      q.push(to);
    }
  }
  stree dt(n);
  vector<int> used(n);
  for (int i = 0; i < k; i++) {
    if (used[d[aa[i]]] == 1) return cout << d[n - 1], 0;
    used[d[aa[i]]] = 1;
    dt.update(d[aa[i]], d1[aa[i]]);
  }
  int mmax = 0;
  for (int i = 0; i < k; i++) {
    mmax = max(mmax, d[aa[i]] + 1 + dt.getmax(d[aa[i]] + 1, n));
  }
  cout << min(d[n - 1], mmax) << '\n';
}
