#include <bits/stdc++.h>
using namespace std;
inline int read() {
  char ch = getchar();
  int nega = 1;
  while (!isdigit(ch)) {
    if (ch == '-') nega = -1;
    ch = getchar();
  }
  int ans = 0;
  while (isdigit(ch)) {
    ans = ans * 10 + ch - 48;
    ch = getchar();
  }
  if (nega == -1) return -ans;
  return ans;
}
int add(int x, int y) { return x + y >= 998244353 ? x + y - 998244353 : x + y; }
int sub(int x, int y) { return x - y < 0 ? x - y + 998244353 : x - y; }
int mul(int x, int y) { return 1LL * x * y % 998244353; }
vector<int> G[200005];
int a[200005];
bool s[200005];
int n, m, k;
int dis[200005];
int dm[200005];
int fa[200005];
bool iw[200005];
void dij() {
  for (int i = 1; i <= n; i++) dis[i] = 200005;
  dis[1] = 0;
  queue<int> q;
  q.push(1);
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (int v : G[u]) {
      if (dis[v] > dis[u] + 1) {
        fa[v] = u;
        dis[v] = dis[u] + 1;
        q.push(v);
      }
    }
  }
}
void dij2() {
  for (int i = 1; i <= n; i++) dm[i] = 200005;
  dm[n] = 0;
  queue<int> q;
  q.push(n);
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (int v : G[u]) {
      if (dm[v] > dm[u] + 1) {
        fa[v] = u;
        dm[v] = dm[u] + 1;
        q.push(v);
      }
    }
  }
}
bool cmp(int x, int y) {
  if (dis[x] != dis[y]) return dis[x] > dis[y];
  return dm[x] > dm[y];
}
signed main() {
  cin >> n >> m >> k;
  for (int i = 1; i <= k; i++) a[i] = read();
  for (int i = 1; i <= k; i++) s[a[i]] = 1;
  for (int i = 1; i <= m; i++) {
    int u = read(), v = read();
    G[u].push_back(v), G[v].push_back(u);
  }
  dij();
  dij2();
  int ans = 0;
  sort(a + 1, a + k + 1, cmp);
  int maxn = dm[a[1]];
  for (int i = 2; i <= k; i++) {
    if (dis[a[i]] + maxn + 1 > ans) ans = dis[a[i]] + maxn + 1;
    if (dm[a[i]] > maxn) maxn = dm[a[i]];
  }
  cout << min(ans, dis[n]) << endl;
  return 0;
}
